Repository navigation
ci: pin every workflow action to a commit SHA - #619
Conversation
gloryfromca
left a comment
There was a problem hiding this comment.
Blocking: enable the documented SHA-pinning guard or stop claiming that the repository enforces it.
Reviewed the full origin/main...HEAD diff, repository guidance (CLAUDE.md), all workflow callers and uses: entries, Dependabot configuration, and relevant workflow history. I also checked backward compatibility: each current external action is pinned to 40 hex characters, and the three SHAs resolve to the documented upstream versions (actions/checkout v7.0.1, astral-sh/setup-uv v10.3.3, and the peeled pypa/gh-action-pypi-publish v1.14.3 commit). No tests or gates were weakened; none were changed.
Validation: git diff --check, scripts/check_docs.py, and scripts/check_github_contributor_docs.py passed; a static scan found no current unpinned external uses: entry. GitHub currently reports passing lint, docs, commit-message/title, and package checks; the unit and integration jobs are still pending. The local make docs-check wrapper could not run because this environment lacks make and Ruby, so its two Python checks were run directly; GitHub's links job passed the complete target. One enforcement defect remains inline.
Actions were referenced by tag (actions/checkout@v7, astral-sh/setup-uv@v10.3.3) or by branch (pypa/gh-action-pypi-publish@release/v1). A tag or branch can be moved to other code, and the publish job holds the PyPI upload token, so a compromised upstream ref would run in our release. Each uses: now names the commit those refs point to today, with the version in a trailing comment that Dependabot updates together with the SHA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repository setting that refuses unpinned actions is turned on only after this branch lands; until then the docs must not say it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b85fc27 to
28fbeaf
Compare
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
The range comparison shows the original pinning patch is unchanged after the rebase; the new commit only removes the unsupported enforcement claim, which settles the prior finding. Reviewed the full origin/main...HEAD diff and revision delta against the project guidance, workflow callers, Dependabot/history, backward compatibility, and test impact. Architecture constraints are not implicated, and no tests or gates were weakened.
Validation: git diff --check, scripts/check_docs.py, and scripts/check_github_contributor_docs.py passed, and every current external uses: reference matches a full 40-character SHA. GitHub's lint, docs, commit checks, and package build pass; unit and integration jobs are still pending. The settled thread was replied to and resolved.
Kendrick-Song
left a comment
There was a problem hiding this comment.
Approving. Each pinned SHA was checked with the GitHub API against the reference it replaces:
actions/checkout:v7andv7.0.1both resolve to3d3c42e5aac5ba805825da76410c181273ba90b1astral-sh/setup-uv:v10.3.3resolves to68559e99cc807c1eb7e9238fd43a15bba460eec2pypa/gh-action-pypi-publish: the head ofrelease/v1and the annotated tagv1.14.3(dereferenced) both resolve to7245906fb61fa33a13554f9d5fb856fe61758086
No unpinned uses: is left in the four workflows, and .github/dependabot.yml already covers github-actions. After merge, the repository setting that requires full-length SHA pins still has to be turned on by an admin.
Summary
Workflow actions were referenced by tag (
actions/checkout@v7,astral-sh/setup-uv@v10.3.3) or by branch (pypa/gh-action-pypi-publish@release/v1). The owner of a tag or branch can point it at other code, and the release job holds the PyPI Trusted Publishing token. A compromised upstream ref would therefore run inside our release.Each
uses:now names the commit those refs point to today, with the exact version in a trailing comment. Dependabot updates the SHA and the comment together. No action version changes:actions/checkout@v7@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1(same commit asv7)astral-sh/setup-uv@v10.3.3@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3pypa/gh-action-pypi-publish@release/v1@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3(current head ofrelease/v1)docs/engineering.mdstates the rule.docs/github-sync.mdhad a stalecheckout@v6note, now fixed. Once this merges, the repository setting "Require actions to be pinned to a full-length commit SHA" gets turned on. It has to come after the merge, because with tag references every workflow would fail.Area
Verification
Checklist
main..envfiles, dependency folders, or generated output.Notes for Reviewers
release.ymlcannot be exercised before the next tag. Its pinned commits are the ones the previous references resolve to today, so the next release runs the same code it would have run with the old references.By submitting this pull request, I agree that my contribution is licensed under
the Apache License 2.0.
🤖 Generated with Claude Code