Skip to content

CI: pin lockfile-audit actions to commit SHAs - #6902

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
anxkhn:ci/pin-lockfile-audit-shas
Jul 6, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
anxkhn:ci/pin-lockfile-audit-shas

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

.github/workflows/lockfile-audit.yml is the only workflow still referencing
GitHub Actions by mutable tag:

- uses: actions/checkout@v4
- uses: actions/setup-python@v5

Every other uses: across .github/workflows/ is pinned to a full 40-char
commit SHA, and security-audit.yml's "GitHub Actions pinning verifier" step
exists specifically to flag non-SHA-pinned references. A mutable tag can be
force-moved to an arbitrary commit (the class of attack behind the
tj-actions/changed-files compromise that the harden-runner comments already
cite), so these two lines are the one spot in the tree where that mitigation is
missing.

The blast radius is limited: this job only runs python3 -c ast.parse plus
scripts/lockfile_supply_chain_audit.py under permissions: contents: read,
so a hijacked action here could tamper with the audit result or read the
read-scoped token, but not write to the repo. It is still a real
self-consistency gap in the supply-chain hardening the project clearly cares
about.

Fix

Pin both references to the commit SHAs behind the versions the rest of the tree
is already moving to, keeping the repo's SHA # vX.Y.Z comment format:

  • actions/checkout@v4 -> actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
  • actions/setup-python@v5 -> actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0

Both SHAs were verified against the upstream tag refs. After this change, no
uses: in .github/workflows/ resolves to a mutable tag. Dependabot's
github-actions ecosystem keeps the SHAs current afterwards, exactly like every
other reference.

Notes

An open Dependabot actions bump (#6893) advances every other checkout /
setup-python reference across the workflow tree to these same two SHAs
(v7.0.0 / v6.3.0), but for this file it only bumps the two lines above to the
mutable tags @v7 / @v6. So it does not close this gap; if it merges as-is,
lockfile-audit.yml becomes the only file left with mutable-tag first-party
references. SHA-pinning here is still required for this workflow to match the
rest of the tree and satisfy the pinning verifier.

lockfile-audit.yml is the only workflow still referencing GitHub Actions
by mutable tag (actions/checkout@v4, actions/setup-python@v5). Every
other uses: across .github/workflows/ is pinned to a 40-char commit SHA,
and security-audit.yml's Actions pinning verifier exists to flag exactly
this gap. A force-moved tag (the tj-actions/changed-files attack class)
could otherwise redirect this audit job to an arbitrary commit.

Pin both to the SHAs behind the versions the rest of the tree is moving
to (checkout v7.0.0, setup-python v6.3.0). The open Dependabot actions
bump only advances these two refs to the mutable tags @v7 / @v6, so it
does not close this gap; SHA-pinning here is still needed for
lockfile-audit.yml to match every other workflow and satisfy the pinning
verifier. Dependabot's github-actions ecosystem keeps the SHAs current
afterwards.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 6, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 11fbb17a90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen danielhanchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified both pinned SHAs resolve to the upstream checkout v7.0.0 and setup-python v6.3.0 tags, and that these were the only remaining mutable-tag references across the workflow tree. Thanks for closing the gap.

@danielhanchen
danielhanchen merged commit 487b420 into unslothai:main Jul 6, 2026
1 check passed
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.

2 participants