Skip to content

Commit

Permalink
fix: Update CI Python script for new JSON structure
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse committed Jan 17, 2024
1 parent a2e133b commit f48c43b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/verify_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
f = open('verified-mods.json')
manifesto = json.load(f)

for mod in manifesto:
# Check verified mods on Thunderstore
manifesto_thunderstore = manifesto['thunderstore']
for mod in manifesto_thunderstore:
print('Verifying "{}":'.format(mod))

# Build GitHub API link and fetch distant tags list
words = manifesto[mod]['Repository'].split('/')
words = manifesto_thunderstore[mod]['Repository'].split('/')
tags_url = "https://api.github.com/repos/{}/{}/tags".format(words[-2], words[-1])
response = urlopen(tags_url)
tags_data = json.loads(response.read())

# Check all mod versions one-by-one
for version in manifesto[mod]['Versions']:
for version in manifesto_thunderstore[mod]['Versions']:
local_hash = version['CommitHash']
matching_distant_versions = list(filter(lambda v: v['name'] == version['Version'], tags_data))

Expand Down

0 comments on commit f48c43b

Please sign in to comment.