Try to pull version name from CI env vars
What changed, and why it matters
This commit changes how the SeedSigner software figures out its own version number when it cannot read version info from the local git repository. Instead of immediately giving up, it now checks whether it is running inside GitHub Actions and, if so, uses environment variables provided by GitHub to determine the version. There is no security issue visible in this change.
No security action required. Reviewers may optionally verify that GITHUB_REF_NAME and GITHUB_SHA are not used for any security-critical decision elsewhere, but this commit itself is benign.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies src/seedsigner/helpers/version.py. Previously, if the code could not determine a version name from git tags or commit hashes, it raised an exception. The new behavior first checks os.getenv(‘CI’) == ‘true’, then falls back to GITHUB_REF_NAME or the first seven characters of GITHUB_SHA. Only if those are also unavailable does it raise a slightly updated exception. The change is purely a build/CI compatibility improvement and does not introduce input handling, cryptographic, or access-control changes.
Changed components
src/seedsigner/helpers/version.pyInspect captured patch +6 / −1
diff --git a/src/seedsigner/helpers/version.py b/src/seedsigner/helpers/version.py
index 6e65ca8..0fe1de1 100644
--- a/src/seedsigner/helpers/version.py
+++ b/src/seedsigner/helpers/version.py
@@ -132,7 +132,12 @@ class Version:
name = commit_hash[:7] # short commit hash
if name is None:
- raise Exception("Could not determine version from git info.")
+ # If we're running in the Github Actions CI, we'll have env vars we can use
+ if os.getenv("CI") == "true":
+ name = os.getenv("GITHUB_REF_NAME") or os.getenv("GITHUB_SHA")[:7]
+
+ if name is None:
+ raise Exception("Could not determine version from git info nor CI env vars.")
return _prefix_version_name(name)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.