Skip to content

ci: pin third-party actions to commit SHAs - #652

Merged
samgbafa merged 5 commits into
mainfrom
fix/ci-sha-pin-actions
Nov 19, 2026
Merged

samgbafa merged 5 commits into
mainfrom
fix/ci-sha-pin-actions

Conversation

@samgbafa

@samgbafa samgbafa commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Pins every third-party (and first-party actions/*) GitHub Action uses: reference in .github/workflows/ to its full 40-character commit SHA, with the original tag kept as a trailing comment (# v4, # 1.97.1, etc.). No versions changed — only the ref form. No .github/actions/ composite actions exist in this repo. All reusable-workflow calls here are local jobs/steps, not remote org/repo/.github/workflows/...@ref calls, so none applied.

Why

A mutable tag lets the upstream repo silently change what code runs in CI. docker.yml builds and pushes to GHCR and, in deploy-phala, runs in the production environment holding PROD_TINYCLOUD_ADMIN_SECRET and the Phala deploy path; release.yml/release-plz.yml push releases and crates.io/npm-equivalent publishes with RELEASE_PLZ_TOKEN/CARGO_REGISTRY_TOKEN. A tag-based action is a supply-chain path into those secrets.

Table (action, tag, resolved commit SHA)

Action Tag Commit SHA
actions/cache v4 0057852bfaa89a56745cba8c7296529d2fc39830
actions/cache/restore v4 0057852bfaa89a56745cba8c7296529d2fc39830
actions/cache/save v4 0057852bfaa89a56745cba8c7296529d2fc39830
actions/checkout v4 11d5960a326750d5838078e36cf38b85af677262
actions/checkout v6 d23441a48e516b6c34aea4fa41551a30e30af803
actions/download-artifact v8 9000827ccba6bdab643e8b6fd33ac0654aef8333
actions/setup-node v4 49933ea5288caeca8642d1e84afbd3f7d6820020
actions/setup-python v5 a26af69be951a213d495a4c3e4e4022e16d87065
actions/upload-artifact v4 ea165f8d65b6e75b540449e92b4886f43607fa02
actions/upload-artifact v7 cf430e030ddbb5b0abf93d22962f4752f3646cd9
docker/build-push-action v5 ca052bb54ab0790a636c9b5f226502c73d547a25
docker/login-action v3 c94ce9fb468520275223c153574b00df6fe4bcc9
docker/metadata-action v5 c299e40c65443455700f0fdfc63efafe5b349051
docker/setup-buildx-action v3 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
dtolnay/rust-toolchain 1.97.1 766a42937d994bd78bb4591385445c188ccb3f09
oven-sh/setup-bun v2 0c5077e51419868618aeaa5fe8019c62421857d6
release-plz/action v0.5 66b324fd6c72d05d2a08568492ecdd62bfb8a62b

Notes on resolution: dtolnay/rust-toolchain@1.97.1 is a branch, not a tag (git/ref/tags/1.97.1 404s; resolved via git/ref/heads/1.97.1). release-plz/action@v0.5 is an annotated tag; dereferenced through git/tags/<sha> to its commit. Swatinem/rust-cache@6323deb1... was already SHA-pinned before this PR (used throughout rust.yml, personal-node.yml, etc.) — left untouched, re-verified below.

107 lines of uses: touched across 11 files.

Works

Listing script (read-only) — zero third-party/first-party uses: lines left on a tag or branch:

$ grep -rn "uses:" .github/workflows .github/actions 2>/dev/null | grep -vP '@[0-9a-f]{40}( #|$)' || echo "NONE FOUND - all pinned"
NONE FOUND - all pinned

Every SHA in the final workflow files resolves against gh api repos/OWNER/REPO/commits/SHA (all 200, including Swatinem/rust-cache which was already pinned):

Swatinem/rust-cache @ 6323deb1... -> HTTP/2.0 200 OK
actions/cache @ 0057852b... -> HTTP/2.0 200 OK
actions/checkout @ 11d5960a... -> HTTP/2.0 200 OK
actions/checkout @ d23441a4... -> HTTP/2.0 200 OK
actions/download-artifact @ 9000827c... -> HTTP/2.0 200 OK
actions/setup-node @ 49933ea5... -> HTTP/2.0 200 OK
actions/setup-python @ a26af69b... -> HTTP/2.0 200 OK
actions/upload-artifact @ ea165f8d... -> HTTP/2.0 200 OK
actions/upload-artifact @ cf430e03... -> HTTP/2.0 200 OK
docker/build-push-action @ ca052bb5... -> HTTP/2.0 200 OK
docker/login-action @ c94ce9fb... -> HTTP/2.0 200 OK
docker/metadata-action @ c299e40c... -> HTTP/2.0 200 OK
docker/setup-buildx-action @ 8d2750c6... -> HTTP/2.0 200 OK
dtolnay/rust-toolchain @ 766a4293... -> HTTP/2.0 200 OK
oven-sh/setup-bun @ 0c5077e5... -> HTTP/2.0 200 OK
release-plz/action @ 66b324fd... -> HTTP/2.0 200 OK
(all 200 OK)

actionlint 1.6.25: no new findings. Pre-existing, unrelated findings only (shellcheck style/info notes in docker.yml and release.yml, the known ubuntu-24.04 runner-label note in logship.yml's hosted-compose job, none touching a uses: line).

No changeset system in this repo (release-plz for Rust, no .changeset/ check workflow) — nothing to add.

CI note: the logship hosted-compose-proof job fails at random on UDP burst loss (TC-3525); it failed that way at a2892d8 and was rerun once.

Details: TC-3512

Builder and others added 4 commits November 19, 2026 01:49
Pins every third-party (and first-party actions/*) GitHub Action used in .github/workflows/ to its full 40-char commit SHA, keeping the original tag as a trailing comment. docker.yml holds GHCR push credentials and the Phala deploy path (PROD_TINYCLOUD_ADMIN_SECRET, production environment); a mutable tag on a marketplace action is a supply-chain risk there.
Integrates main 8c970cf while retaining the action references.
This is a single-parent integration snapshot, not a true merge commit.
test-ruling: Existing-test changes are inherited unchanged from main during integration.
Configure cargo-dist action refs in Cargo.toml so workflow generation retains the existing revisions.
Move release action version labels beside those refs; retain generated-workflow consistency checks.
- Integrate origin/main 8774fca and retain the PR feature unchanged.
- Resolve only the additive changelog overlap; retain the production compose and release workflow changes from main.
- Single-parent content integration snapshot: the selective commit API cannot create merge parents.
test-ruling: TC-1491 retain the production compose fixture artifact-read limit from main (2026-11-19)
@samgbafa
samgbafa marked this pull request as ready for review November 19, 2026 19:57
CHANGELOG conflict only: keep main's TC-1387 line. Workflow pins apply on top of #646's probe schedules.

Details: TC-3512
@samgbafa
samgbafa merged commit 036c3e2 into main Nov 19, 2026
41 of 42 checks passed
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