summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndrii Klymenko <a.klymenko@vyos.io>2026-07-11 15:02:40 +0300
committerGitHub <noreply@github.com>2026-07-11 15:02:40 +0300
commitb5e3dfce57e237b60e05cfda804db1910e2a1f76 (patch)
tree53c1ca4c4029c347e2ff829da955b6af0f158861 /scripts
parented6f7b5ef0a47b30342e565c32d9f90764d250f0 (diff)
parent98d463a025e307ac370069bfe9a49e7b0a5b8eaf (diff)
downloadcommunity.vyos.net-b5e3dfce57e237b60e05cfda804db1910e2a1f76.tar.gz
community.vyos.net-b5e3dfce57e237b60e05cfda804db1910e2a1f76.zip
Merge pull request #65 from vyos/new-assets-amount-fix
Match assets by filename instead of by position
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/list-nightly-builds.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/list-nightly-builds.py b/scripts/list-nightly-builds.py
index 5f72a43..b0ebe1a 100755
--- a/scripts/list-nightly-builds.py
+++ b/scripts/list-nightly-builds.py
@@ -24,16 +24,25 @@ def list_images(repo):
# so we don't need to sort them
releases = repo.get_releases()
for r in releases:
- iso = r.assets[1]
- sig = r.assets[2]
+ # Match assets by filename instead of by position: each release has
+ # exactly one ISO plus its Minisign signature (<iso-name>.minisig),
+ # alongside other assets (checksums, source archives, etc.) whose
+ # count varies over time. Index-based access breaks whenever that
+ # count changes, so look the pair up by name.
+ assets = {a.name: a for a in r.assets}
+
+ iso = next((a for name, a in assets.items() if name.endswith(".iso")), None)
+ if iso is None:
+ continue # no ISO in this release, skip
+
+ sig = assets.get(iso.name + ".minisig")
+ if sig is None:
+ continue # ISO without a signature, skip
- # Nightly build releases have two assets:
- # an ISO and a Minisign signature file
- # The signature is always the second asset in the list
image = {}
image["iso_url"] = iso.browser_download_url
image["sig_url"] = sig.browser_download_url
- image["title"] = r.title
+ image["title"] = r.name # r.title is deprecated in PyGithub
images.append(image)
@@ -57,4 +66,4 @@ if __name__ == '__main__':
repo = gh.get_repo(REPO)
images = list_images(repo)
- print(render_image_list(images))
+ print(render_image_list(images)) \ No newline at end of file