Skip to content

ci: pin every action to a commit SHA, kept current by Dependabot - #42

Open
prabod wants to merge 1 commit into
mainfrom
chore/pin-actions
Open

prabod wants to merge 1 commit into
mainfrom
chore/pin-actions

Conversation

@prabod

@prabod prabod commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Third-party actions referenced by tag (@v4, @stable) run whatever the tag points to today, so a compromised upstream can push new code under the same tag. The release job runs these actions with contents: write and the crates.io token in reach.

  • Every uses: across the 5 workflows is now pinned to the commit its tag currently resolves to, with the exact version in a comment (actions/checkout@11d5960… # v4.4.0). Same code as today, so behaviour shouldn't change.
  • dtolnay/rust-toolchain is pinned to its stable branch's head. That commit's toolchain input defaults to stable, so no with: change is needed. Dependabot can't bump a branch pin, so update this one by hand occasionally.
  • .github/dependabot.yml: a weekly grouped PR keeps the pinned SHAs current. Rust security updates come from Dependabot security updates, which are now enabled in settings.

After this merges, Settings → Actions → General → "Require actions to be pinned to a full-length commit SHA" can be turned on, so new unpinned actions get rejected.

A tag can be moved to other code; a commit SHA cannot. The release job runs
these actions with contents: write and the crates.io token in reach, so each
is pinned to the commit its tag points at today, with the version beside it.
dtolnay/rust-toolchain is pinned to its stable branch's head, whose default
toolchain is stable. Dependabot updates the pins weekly in one PR.

This branch has not been deployed

No deployments
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