Skip to content

Commit fbc9c84

Browse files
committed
fix(release): scope Trusted Publishing OIDC to publish job
Keep package-macos on contents:read with persist-credentials disabled so macOS packaging cannot request the npm OIDC token before release gates.
1 parent 03c4e8a commit fbc9c84

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ on:
2929
required: false
3030
type: string
3131

32-
permissions:
33-
contents: write # create the matching GitHub Release + version tag after npm publish
34-
actions: read # verify CI and download the macOS workflow artifact
35-
id-token: write # OIDC auth for Trusted Publishing + automatic provenance attestation
32+
permissions: {}
3633

3734
concurrency:
3835
group: release
@@ -42,12 +39,16 @@ jobs:
4239
package-macos:
4340
runs-on: macos-latest
4441
timeout-minutes: 15
42+
permissions:
43+
contents: read
4544
outputs:
4645
archive_name: ${{ steps.package.outputs.archive_name }}
4746
checksum_name: ${{ steps.package.outputs.checksum_name }}
4847
steps:
4948
- name: Checkout
5049
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
50+
with:
51+
persist-credentials: false
5152

5253
- name: Build universal macOS release asset
5354
id: package
@@ -71,6 +72,10 @@ jobs:
7172
needs: package-macos
7273
runs-on: ubuntu-latest
7374
timeout-minutes: 15
75+
permissions:
76+
contents: write # create the matching GitHub Release + version tag after npm publish
77+
actions: read # verify CI and download the macOS workflow artifact
78+
id-token: write # OIDC auth for Trusted Publishing + automatic provenance attestation
7479
steps:
7580
- name: Checkout
7681
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
@@ -241,7 +246,7 @@ jobs:
241246
fi
242247
243248
# Tokenless publish via Trusted Publishing (OIDC) — NO NPM_TOKEN secret. npm auto-detects the
244-
# OIDC environment (`id-token: write` above) and generates provenance automatically, so neither a
249+
# OIDC environment (`id-token: write` on this job) and generates provenance automatically, so neither a
245250
# token nor `--provenance` is needed. `npm publish` runs prepublishOnly first (typecheck + build
246251
# the GUI into gui/dist), so even a dry-run fully verifies the build.
247252
# PREREQUISITE: configure the Trusted Publisher for this repo + workflow on npmjs.com — possible

0 commit comments

Comments
 (0)