Skip to content

chore: pin GitHub Actions to commit SHAs#111

Merged
lwshang merged 7 commits intomainfrom
chore/pin-actions-to-sha
Apr 9, 2026
Merged

chore: pin GitHub Actions to commit SHAs#111
lwshang merged 7 commits intomainfrom
chore/pin-actions-to-sha

Conversation

@slawomirbabicz
Copy link
Copy Markdown
Contributor

@slawomirbabicz slawomirbabicz commented Apr 8, 2026

Pin GitHub Actions to commit SHAs

GitHub Actions referenced by tag (e.g. `actions/checkout@v4`) use a mutable pointer — the tag owner can move it to a different commit at any time. Pinning to a full 40-character commit SHA makes the reference immutable, with a `# vX.Y.Z` comment preserving human readability.

Pinned actions

Action SHA Version
actions/checkout de0fac2e4500dabe0009e67214ff5f5447ce83dd v6.0.2
actions/upload-artifact b7c566a772e6b6bfb58ed0dc250532a479d7789f v6.0.0
actions/download-artifact 37930b1c2abaa49bbe596cd826c3c89aef350131 v7.0.0
actions/cache 668228422ae6a00e4ad889ee87cd7109ec5666a7 v5.0.4
actions/setup-node 53b83947a5a98c8d113130e565377fae1a50d02f v6.3.0
rust-lang/crates-io-auth-action b7e9a28eded4986ec6b1fa40eeee8f8f165559ec v1.0.3
dfinity/setup-dfx e50c04f104ee4285ec010f10609483cf41e4d365 main

dist-generated release.yml

release.yml is auto-generated by cargo-dist and must not be edited manually — it will be overwritten on the next dist generate run. To keep the pinned SHAs across regenerations, the action-to-SHA mapping is declared in dist-workspace.toml under [dist.github-action-commits]. Running dist generate will always produce release.yml with the hashes specified there.

Other fixes

  • Removed erroneous environment: release from release-npm.yml (the environment did not exist in the repo, and its presence would have altered the OIDC token subject claim, breaking npm trusted publishing)

@slawomirbabicz slawomirbabicz requested a review from a team as a code owner April 8, 2026 15:25
lwshang and others added 2 commits April 9, 2026 10:59
Use dist's github-action-commits config to pin actions/checkout,
actions/upload-artifact, and actions/download-artifact to specific
commit SHAs, satisfying the security policy requirement.

Also upgrades cargo-dist-version from 0.30.3 to 0.31.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- actions/checkout: v4.3.1 → v6.0.2
- actions/cache: v4.3.0 → v5.0.4
- actions/setup-node: v4.4.0 → v6.3.0
- Remove erroneous `environment: release` from release-npm.yml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lwshang lwshang merged commit a69ffcc into main Apr 9, 2026
12 checks passed
@lwshang lwshang deleted the chore/pin-actions-to-sha branch April 9, 2026 15:56
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