Repository navigation
ci: harden workflows — SHA-pin actions, drop inlined SSH key, least-privilege - #583
Merged
Merged
Conversation
Contributor
|
Standing release PR: #582 · v0.41.1 queued (4 packages) · open 1h 36m · ✅ ready to merge Release Preview — v0.41.0 → v0.41.1
These changes will be added to the release PR (#582) when merged: Changelogmonorepo 0.41.0 → 0.41.1
After merge — predicted release
Updated automatically by ReleaseKit |
goosewobbler
force-pushed
the
ci/harden-workflows
branch
from
July 19, 2026 22:31
eb76102 to
7111c15
Compare
…st-privilege Pin mutable third-party actions to full commit SHAs (amannn/action- semantic-pull-request, dtolnay/rust-toolchain, dorny/paths-filter, pnpm/action-setup) so a repointed tag can't run with CI privileges; Dependabot's github-actions ecosystem can bump them. Remove the inlined SSH private key from _release.reusable.yml (buggy and redundant with actions/checkout's ssh-key:). Scope the release.yml check-labels job to contents: read. Closes #560 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BT6fVBZrmExXZj7vQ29881
goosewobbler
force-pushed
the
ci/harden-workflows
branch
from
July 19, 2026 22:42
7111c15 to
d4a5bf5
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defense-in-depth hardening of the CI workflows (from the 2026-07-19 security review, #560). No confirmed-exploitable RCE — these are supply-chain and least-privilege tightenings, scoped to
.github/workflows/*.yml.pull_request_target(pr-title.yml,amannn/action-semantic-pull-request) to a full SHA._release.reusable.yml(git config --global core.sshCommand "ssh -i <key>…") — it inlined key material into a shell command, was buggy (ssh -iexpects a file path), and is redundant withactions/checkout'sssh-key:. The deploy key still flows through checkout.permissions: { contents: read }to therelease.ymlcheck-labelsjob (read-onlygh apicalls).dtolnay/rust-toolchain@stable,dorny/paths-filter@v4,pnpm/action-setup@v5/@v6) to full SHAs so Dependabot can manage them.First-party
actions/*andgithub/codeql-actionare left as-is per the issue's scope; consumer-facing docs/templates keep readable tags.Test plan
gh api repos/<owner>/<repo>/commits/<tag> --jq .sha, verified by the orchestrator (all four spot-checks match), and each pin carries a# <tag>comment.pnpm turbo run lint typecheck test— all 32 tasks pass;pnpm lint— exit 0.Closes #560
🤖 Generated with Claude Code
https://claude.ai/code/session_01BT6fVBZrmExXZj7vQ29881
Greptile Summary
This PR hardens the CI/CD supply chain by SHA-pinning all mutable third-party action tags, removing a broken inlined SSH key step, and adding minimal required permissions to the
check-labelsjob.amannn/action-semantic-pull-request,dorny/paths-filter,dtolnay/rust-toolchain,pnpm/action-setup) are pinned to verified full commit SHAs with tag comments, making Dependabot-managed updates possible.git config core.sshCommand "ssh -i <key>"step in_release.reusable.ymlis removed; it was never functional (ssh -irequires a file path, not raw key material) and redundant with thessh-key:input already passed toactions/checkout.check-labelsjob inrelease.ymlgains explicitcontents: readandpull-requests: readpermissions, the latter required for thegh api repos/.../commits/.../pullscall to succeed.Confidence Score: 5/5
Safe to merge — all changes are pure hardening with no logic modifications to release or CI orchestration.
Every change is a targeted security improvement: SHA pins replace mutable tags, a broken and redundant SSH inlining step is removed, and a missing permission is added to a read-only job. No business logic is touched, and the pull-requests: read addition directly addresses the previously flagged gap in check-labels.
No files require special attention. release.yml is the most sensitive file changed but its edit is minimal and correct.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[workflow_run: CI on main] --> B[check-labels\ncontents:read + pull-requests:read] B -->|gh api commits/SHA/pulls| C{Release label?} C -->|yes| D[release-auto\nid-token:write / contents:write] C -->|no| E[Skip] D --> F[_release.reusable.yml] F --> G[Checkout via ssh-key input] F --> H[Build + releasekit] J[pull_request_target] --> K[pr-title.yml\nSHA-pinned: amannn @48f2562] subgraph Pinned Actions L[dorny/paths-filter @7b450ff] M[dtolnay/rust-toolchain @4cda84d] N[pnpm/action-setup v5 @fc06bc1] O[pnpm/action-setup v6 @0ebf471] end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[workflow_run: CI on main] --> B[check-labels\ncontents:read + pull-requests:read] B -->|gh api commits/SHA/pulls| C{Release label?} C -->|yes| D[release-auto\nid-token:write / contents:write] C -->|no| E[Skip] D --> F[_release.reusable.yml] F --> G[Checkout via ssh-key input] F --> H[Build + releasekit] J[pull_request_target] --> K[pr-title.yml\nSHA-pinned: amannn @48f2562] subgraph Pinned Actions L[dorny/paths-filter @7b450ff] M[dtolnay/rust-toolchain @4cda84d] N[pnpm/action-setup v5 @fc06bc1] O[pnpm/action-setup v6 @0ebf471] endReviews (3): Last reviewed commit: "ci: harden workflows — pin actions to SH..." | Re-trigger Greptile