Skip to content

Commit

Permalink
Merge pull request #216 from karnotxyz/revert-202-update-in-github-wo…
Browse files Browse the repository at this point in the history
…rkflow

Revert "Revise GitHub workflow to include build and commit steps"
  • Loading branch information
anukkrit149 authored Jan 27, 2024
2 parents e356b47 + c0b18b3 commit 70af43f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/validate-entry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: ["main"]

jobs:
validate-and-build:
validate-entry:
runs-on: ubuntu-latest

steps:
Expand All @@ -26,15 +26,3 @@ jobs:
- name: Validate Entry
run: python .github/workflows/validate.py

- name: Commit Changes
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add listing.json
git commit -m "Added New Entry for avail campaign"
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN }}
15 changes: 0 additions & 15 deletions .github/workflows/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import sys

APP_CHAIN_DIRECTORY = os.path.join(os.getcwd(), "app_chains")
LISTING_JSON_LOC = os.path.join(os.getcwd(), "listing.json")
JSON_URL = "https://raw.githubusercontent.com/karnotxyz/avail-campaign-listing/main/listing.json"
TIMEOUT_IN_MS = 500

Expand Down Expand Up @@ -144,22 +143,8 @@ def check_duplicate_urls_in_latest_entry():
return new_entry


def append_to_json_file(data, file_path):
try:
with open(file_path, 'r+') as file:
file_data = json.load(file)
file_data.append(data)
file.seek(0)
json.dump(file_data, file, indent=4)
print(f"Data appended successfully to {file_path}")
except Exception as e:
print(f"Error in appending to file: {e}")
sys.exit(1)


if __name__ == "__main__":
latest_entry = check_duplicate_urls_in_latest_entry()
if latest_entry:
check_required_keys(latest_entry)
check_url_status_code(latest_entry)
append_to_json_file(latest_entry, LISTING_JSON_LOC)

0 comments on commit 70af43f

Please sign in to comment.