Repository navigation
chore: pin GitHub Actions to commit SHAs - #13
Merged
Merged
Conversation
AUDIT.md P2#15: every action reference across this repo's 2 workflows was pinned to a mutable version tag (@v4 through @v7). A tag can be moved to point at a different commit -- by the upstream maintainer, or by anyone who compromises their account -- and every workflow using it would silently start executing different code on its next run. Each reference now pins the exact commit the tag currently resolves to, with the tag kept as a trailing comment for readability (GitHub's own recommended convention: `owner/repo@<sha> # vN`). Resolved via the GitHub API (git/refs/tags, dereferencing through the tag object where the ref points at one rather than a commit directly) rather than guessed, and spot-verified two of the resulting SHAs against their own commit metadata (dates and messages consistent with the claimed release) before trusting the rest. actions/checkout@v5 -> fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 actions/setup-python@v6 -> ece7cb06caefa5fff74198d8649806c4678c61a1 actions/upload-artifact@v7 -> 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a docker/build-push-action@v7 -> 53b7df96c91f9c12dcc8a07bcb9ccacbed38856a docker/login-action@v4 -> dbcb813823bdd20940b903addbd779551569679f docker/setup-buildx-action@v4 -> 37fe631027851001ddb9b187196cc803df7f5f0e docker/setup-qemu-action@v4 -> 1f40c72289eff860ee54a304f1438e3cff362e0a tests/test_container_permissions.py had two assertions relying on bare `"docker/action-name@vN"` substrings appearing verbatim, which no longer holds once the tag and the commit SHA share a line. Updated both to regex assertions (`docker/action-name@[0-9a-f]{40} # vN`) that still confirm the version, just not by exact substring, and to search for that pattern rather than the bare string when checking step ordering. Verified: YAML still parses for every touched file, no CRLF introduced, full pytest suite's failing-test set is byte-identical to the known Windows-platform baseline (diffed), the two specifically-updated tests pass, ruff findings unchanged from before this change (3 pre-existing, already reviewed). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes AUDIT.md P2#15: every action reference here was pinned to a mutable version tag. A tag can be moved to point at a different commit -- by the upstream maintainer, or by anyone who compromises their account -- and every workflow using it would silently start executing different code on its next run.
Each reference now pins the exact commit the tag currently resolves to, with the tag kept as a trailing comment for readability (GitHub's own recommended convention:
owner/repo@<sha> # vN).Verification
git/refs/tags, dereferencing through the tag object where the ref points at one rather than a commit directly) -- not guessed./repos/{owner}/{repo}/tagslist endpoint -- a different API path than the original resolution -- rather than trust the first lookup alone. All eight matched.tests/test_container_permissions.pyhad two assertions relying on bare"docker/action-name@vN"substrings, including one checking step ordering viastr.index. Updated both to regex assertions that still confirm the version and the ordering, just not by exact substring.