Github Actions CI timestamp format bugfix
What changed, and why it matters
This commit fixes a small date-parsing bug in the software's version helper. When the code runs in GitHub Actions, Git reports the latest commit time ending in 'Z' (a common UTC notation), but the Python function used to read that date didn't understand 'Z' before Python 3.11. The patch simply replaces 'Z' with '+00:00' so the date parses correctly. It is a compatibility fix, not a security fix.
No security action needed. Treat as a normal CI/bugfix patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is in VersionUtils._get_version_timestamp_from_git_shell(), which shells out to ‘git log -1 –format=%cI’ and parses the result with datetime.fromisoformat(). On GitHub Actions, Git emits ISO 8601 UTC timestamps with a ‘Z’ suffix (e.g., 2025-12-26T19:41:49Z). Python 3.10’s datetime.fromisoformat() does not accept ‘Z’, raising ValueError. The patch normalizes ‘Z’ to ‘+00:00’ before parsing. A unit test is added to cover this format. There is no input from untrusted sources, no injection path, and no change to cryptographic or secret-handling logic.
Changed components
src/seedsigner/helpers/version.pytests/test_version.pyInspect captured patch +14 / −0
diff --git a/src/seedsigner/helpers/version.py b/src/seedsigner/helpers/version.py
index b228dad..e9d71fc 100644
--- a/src/seedsigner/helpers/version.py
+++ b/src/seedsigner/helpers/version.py
@@ -550,6 +550,13 @@ class VersionUtils:
def _get_version_timestamp_from_git_shell(cls) -> datetime | None:
version_timestamp = os.popen("git log -1 --format=%cI").read().strip()
if version_timestamp:
+ if version_timestamp.endswith("Z"):
+ # Git outputs UTC time with a "Z" suffix; datetime.fromisoformat()
+ # doesn't like the "Z" so we replace it with "+00:00"
+ # TODO: Python 3.11+ has fromisoformat() support for "Z" suffixes so this
+ # can be removed once we drop python 3.10 support.
+ version_timestamp = version_timestamp.replace("Z", "+00:00")
+
# Parse the timestamp, ensure that it's in UTC, and omit tz info
return datetime.fromisoformat(version_timestamp).astimezone(timezone.utc).replace(tzinfo=None)
diff --git a/tests/test_version.py b/tests/test_version.py
index 3411942..9a1e40e 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -573,6 +573,13 @@ class TestVersionUtils_GitShell(VersionBaseTest):
mock_popen.return_value.read.return_value = expected_datetime.isoformat() + "+00:00"
assert VersionUtils._get_version_timestamp_from_git_shell() == expected_datetime
+ # Github Actions CI timestamps return "Z" format
+ expected_utc_isoformat = "2025-12-26T19:41:49"
+ github_format = expected_utc_isoformat + "Z"
+ mock_popen.return_value.read.return_value = github_format
+ expected_datetime = datetime.fromisoformat(expected_utc_isoformat)
+ assert VersionUtils._get_version_timestamp_from_git_shell() == expected_datetime
+
class TestVersionUtils_DotGitFiles(VersionBaseTest):
Why this scored 19/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.