Skip to content

Harden CI: SHA-pin all actions, add persist-credentials: false#2

Merged
jpr5 merged 1 commit into
mainfrom
fix/ci-hardening
May 15, 2026
Merged

Harden CI: SHA-pin all actions, add persist-credentials: false#2
jpr5 merged 1 commit into
mainfrom
fix/ci-hardening

Conversation

@jpr5
Copy link
Copy Markdown

@jpr5 jpr5 commented May 15, 2026

Summary

  • SHA-pin every uses: line across all 15 workflow files to immutable commit SHAs, preventing supply chain attacks via mutable tags
  • Add persist-credentials: false to all actions/checkout steps (17 of 18 -- docs.yml exempted because mkdocs gh-deploy requires stored git credentials)
  • Add top-level permissions: contents: read to every workflow to enforce least-privilege token scope

Actions pinned

Action Version SHA
actions/checkout v6 de0fac2e4500dabe0009e67214ff5f5447ce83dd
actions/setup-node v6 48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
actions/setup-python v6 a309ff8b426b58ec0e2a45f0f869d46889d02405
actions/setup-go v6 4a3601121dd01d1626a1e23e37211e3254c1c06c
actions/setup-java v5 be666c2fcd27ec809703dec50e508c2fdc7f6654
actions/cache v5 27d5ce7f107fe9357f9df03efb73ab90386fccae
pnpm/action-setup v4 b906affcce14559ad1aafd4ab0e942779e9f58b1

Files changed

All 15 workflow files under .github/workflows/.

Test plan

  • Verify CI passes on this PR (all existing workflows should behave identically)
  • Confirm docs.yml deploy still works on merge to main (credentials preserved for mkdocs gh-deploy)

- SHA-pin every uses: line across all 15 workflow files to prevent
  supply chain attacks via mutable tags
- Add persist-credentials: false to all checkout steps (except docs.yml
  which needs credentials for mkdocs gh-deploy)
- Add top-level permissions: contents: read to every workflow to enforce
  least-privilege token scope
@jpr5 jpr5 merged commit 1c77617 into main May 15, 2026
16 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