ci: pin third-party GitHub Actions to full commit SHAs (#4922)

Pin every remaining third-party action reference in `.github/` to a full
40-character commit SHA, with the intended version in a trailing comment
(`uses: owner/action@<sha> # vX.Y.Z`), following the pins already in
`cli.yml`, `typos.yml` and `make-release-commit.yml`. Fixes #3293.

53 references across 13 files change, covering 16 actions, including the
branch refs called out in the issue (`dtolnay/rust-toolchain@master`,
`@stable`) and `pypa/gh-action-pypi-publish@release/v1`. Each SHA is the
commit its current tag or branch resolves to today, so the code that
runs is unchanged. Comments name the most specific tag on that commit
(for example `v2.9.3` for `Swatinem/rust-cache@v2`); where no such tag
exists, they keep the original ref (`v1` for `srvaroa/labeler` and
`rui314/setup-mold`, `v3` for `addnab/docker-run-action`,
`stable`/`master` for `dtolnay/rust-toolchain`). The `stable` branch of
`dtolnay/rust-toolchain` defaults its `toolchain` input to `stable`, so
pinning its SHA keeps the `nodejs.yml` step that passes no toolchain on
stable.

GitHub-maintained `actions/*` references are left on their tags, as in
the existing pins. Keeping SHAs current through Dependabot is the
sibling issue and is not part of this change.

Validation:

- No third-party `uses:` reference in `.github/` is left without a
40-character SHA (53 before, 0 after).
- For all 23 distinct third-party pins in `.github/`, `git ls-remote`
against the upstream repository confirms the SHA is the commit that the
commented tag or branch points to. A deliberately altered SHA and a
reverted tag ref were both caught.
- `pre-commit run` on the changed files passes (check-yaml, end-of-file,
trailing whitespace, typos).
- actionlint 1.7.12 reports the same 35 findings on `main` and on this
branch, all of them existing ones (custom runner labels and composite
actions under `workflows/`). It reports none for this change.
This commit is contained in:
Shu Chen
2026-11-19 11:18:10 -08:00
committed by GitHub
parent e0995c39c2
commit c136022c7b
13 changed files with 53 additions and 53 deletions
+10 -10
View File
@@ -42,7 +42,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
- uses: pnpm/action-setup@v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 11.1.1
- uses: actions/setup-node@v6
@@ -52,14 +52,14 @@ jobs:
node-version: 24
cache: 'pnpm'
cache-dependency-path: nodejs/pnpm-lock.yaml
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
components: rustfmt, clippy
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Restore everywhere, but only save from main. Per-PR saves are
# unreadable outside their own branch anyway, since GitHub scopes
@@ -98,7 +98,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
- uses: pnpm/action-setup@v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 11.1.1
- uses: actions/setup-node@v6
@@ -110,7 +110,7 @@ jobs:
node-version: 24
cache: 'pnpm'
cache-dependency-path: nodejs/pnpm-lock.yaml
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Restore everywhere, but only save from main. Per-PR saves are
# unreadable outside their own branch anyway, since GitHub scopes
@@ -188,7 +188,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
- uses: pnpm/action-setup@v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 11.1.1
- uses: actions/setup-node@v6
@@ -196,7 +196,7 @@ jobs:
node-version: 24
cache: 'pnpm'
cache-dependency-path: nodejs/pnpm-lock.yaml
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Same crate, profile and target as the `linux` job above, so reuse
# its cache: rust-cache keys on the job id by default, and this job
@@ -249,7 +249,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
- uses: pnpm/action-setup@v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 11.1.1
- uses: actions/setup-node@v6
@@ -259,11 +259,11 @@ jobs:
cache: 'pnpm'
cache-dependency-path: nodejs/pnpm-lock.yaml
# Use the same pinned compiler for cache selection and the native build.
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Restore everywhere, but only save from main. Per-PR saves are
# unreadable outside their own branch anyway, since GitHub scopes