Skip to content

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

Merged
IsuraManchanayake merged 3 commits into
mainfrom
chore/pin-actions
Oct 27, 2026
Merged

IsuraManchanayake merged 3 commits 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.

prabod and others added 3 commits October 26, 2026 23:45
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.
release.yml: the crates-verify and crates jobs keep the pins #32 gave them
(actions/checkout v7.0.1, dtolnay/rust-toolchain master at 2026-10-16 with
Rust 1.99.1), which built v0.1.5; the build and release jobs take this
branch's.
#32 added the job after this branch pinned every action; its
actions/checkout@v4 was the one tag left, now the v4.4.0 commit the
other jobs use.
@IsuraManchanayake

Copy link
Copy Markdown
Collaborator

Merged main into this branch (0a59a82) and resolved release.yml: the crates-verify and crates jobs keep the pins #32 gave them (actions/checkout v7.0.1 at 3d3c42e5, dtolnay/rust-toolchain master at 683b588c with Rust 1.99.1), since those built v0.1.5; the build and release jobs take this branch's v4.4.0 / stable pins. 1c64d5a pins the one uses: #32 added after this branch was cut, the packaging job's actions/checkout@v4, to the same v4.4.0 commit. Every SHA in both PRs resolves to the tag or branch head its comment names (checked against the GitHub API), and no uses: in the six workflows is left on a tag; publish.yml was already pinned by #32. #41's crates-io and nightly environments came through the merge untouched, so the diff against main is the pins and dependabot.yml only.

rc branch only fails here because #40 landed first and this branch is not an rc-*. It is not a required check yet, so a main-maintainer can still merge this; otherwise it needs re-opening from the next rc branch.

@IsuraManchanayake
IsuraManchanayake merged commit 31c8b47 into main Oct 27, 2026
12 of 13 checks passed
@IsuraManchanayake
IsuraManchanayake deleted the chore/pin-actions branch October 27, 2026 11:50
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