Skip to content

Commit 075ea2f

Browse files
theCodeDriftclaude
andcommitted
ci: harden publish job — no persisted git creds, --ignore-scripts on npm
Two more defense-in-depth findings from the Copilot re-review under the new GHA credential-safety instructions: - persist-credentials: false on the check and publish checkouts — those jobs don't push, so don't leave GITHUB_TOKEN in the local git config (smaller blast radius if a later step uses git/network). - --ignore-scripts on the pinned `npm install -g` so no dependency lifecycle code executes while the publish job holds id-token: write. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9da37e3 commit 075ea2f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ jobs:
8181
publish: ${{ steps.check.outputs.publish }}
8282
steps:
8383
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
84+
with:
85+
persist-credentials: false # no git writes here; don't leave the token in git config
8486
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
8587
with:
8688
node-version: 24
@@ -116,6 +118,8 @@ jobs:
116118
id-token: write # OIDC → short-lived npm auth + build provenance
117119
steps:
118120
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
121+
with:
122+
persist-credentials: false # publish authenticates via OIDC/npm, not git creds
119123
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
120124
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
121125
with:
@@ -127,7 +131,8 @@ jobs:
127131
# OIDC trusted publishing + provenance need npm >= 11.5.1. Pin the version
128132
# (not @latest) so the release is deterministic and a new npm release
129133
# can't change publish behavior unreviewed; bump this intentionally.
130-
- run: npm install -g npm@12.0.1
134+
# --ignore-scripts: no lifecycle code runs while the OIDC identity exists.
135+
- run: npm install -g npm@12.0.1 --ignore-scripts
131136

132137
- run: pnpm --filter @taskless/cli build
133138

0 commit comments

Comments
 (0)