From d689eae14e4abd1da5c1a3111a493c27e406ba47 Mon Sep 17 00:00:00 2001 From: Nathanael Huffman Date: Fri, 15 May 2026 15:35:31 -0400 Subject: [PATCH] fpga-releaser: fix --skip-gh and inverted needs_gh check Commit 5bb07359 reparenthesized the needs_gh expression as 'not (args.skip_gh or args.zip is None)', which evaluates to 'not args.skip_gh and args.zip is not None' -- the opposite of the intent for the default invocation. With no --skip-gh and no --zip, needs_gh became False, api stayed None, and get_latest_artifact_info crashed with AttributeError. Additionally, --skip-gh on its own would fall through to process_gh_build and attempt to fetch artifacts from GitHub, defeating the purpose of the flag. Require --zip or --local when --skip-gh is set so the tool never touches GitHub in that mode. --- tools/fpga_releaser/cli.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/fpga_releaser/cli.py b/tools/fpga_releaser/cli.py index 70df76fe..3dc6452a 100644 --- a/tools/fpga_releaser/cli.py +++ b/tools/fpga_releaser/cli.py @@ -48,8 +48,14 @@ def main(): if args.zip: project_info.local = True - # Only require a GitHub token when we actually need to talk to GitHub - needs_gh = not (args.skip_gh or args.zip is None) + if args.skip_gh and args.zip is None: + print("--skip-gh requires --zip or --local to supply a build archive") + sys.exit(1) + + # Only require a GitHub token when we actually need to talk to GitHub. + # With --skip-gh we have a local archive (enforced above) and won't push a + # release, so the API client stays unused. + needs_gh = not args.skip_gh api = None if needs_gh: if args.token is not None: