Skip to content

chore: pin GitHub Actions to commit SHAs - #13

Merged
Monsterray merged 1 commit into
developfrom
chore/pin-actions-to-sha
Sep 7, 2026
Merged

Monsterray merged 1 commit into
developfrom
chore/pin-actions-to-sha

Conversation

@Monsterray

Copy link
Copy Markdown
Owner

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

  • Resolved every tag via the GitHub API (git/refs/tags, dereferencing through the tag object where the ref points at one rather than a commit directly) -- not guessed.
  • Spot-verified two of the eight resolved SHAs against their own commit metadata (dates and messages consistent with the claimed release) before trusting the rest.
  • Independently cross-checked all eight SHAs a second time, using the /repos/{owner}/{repo}/tags list endpoint -- a different API path than the original resolution -- rather than trust the first lookup alone. All eight matched.
  • YAML still parses for every touched file, no CRLF introduced.
  • Full workspace check (lint + test suite across all three repos) shows no new failures relative to the known Windows-platform baseline.

tests/test_container_permissions.py had two assertions relying on bare "docker/action-name@vN" substrings, including one checking step ordering via str.index. Updated both to regex assertions that still confirm the version and the ordering, just not by exact substring.

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>
@Monsterray
Monsterray merged commit fac61b8 into develop Sep 7, 2026
1 check passed
@Monsterray
Monsterray deleted the chore/pin-actions-to-sha branch September 7, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant