GITv

Pin CI's actions to commits

Browse files

Tags like @v4 can be moved by whoever controls the action's repository, so a compromised upstream could run new code in CI. Each action is now pinned to the commit its release tag named on 2026-11-22, with the version in a comment. rust-toolchain, pinned off its branch, is told the toolchain explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Author
Um9i vulgarmessiah@gmail.com
Date
22 Nov 2026, 22:18
Commit
3e9c128fe32e
Parent
d087586

1 file changed +11−5

@@ -10,6 +10,10 @@ on:
permissions:
contents: read
# Every action is pinned to a commit, not a tag a compromised upstream could move. To update
# one, look up the new release's commit (git ls-remote --tags https://github.com/<owner>/<repo>)
# and change the hash and its comment together.
env:
CARGO_TERM_COLOR: always
@@ -21,11 +25,13 @@ jobs:
timeout-minutes: 20
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable branch
with:
# Pinned to a commit, the action can't read the toolchain from a branch name.
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: cargo fmt --all --check
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
# The integration tests drive real git, rsync, flock and mountpoint, all on the runner.
@@ -37,8 +43,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8
with:
# cargo-about is pinned so THIRD-PARTY-LICENSES only changes when dependencies do.
tool: cargo-audit,cargo-about@0.9.3