Skip to content

Commit 814f028

Browse files
asklarCopilot
andcommitted
Switch to OIDC trusted publisher for npm publishing
Replace NPM_TOKEN secret with GitHub Actions OIDC id-token for authentication. Add --provenance flag for SLSA attestation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4d45a71 commit 814f028

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
1114
steps:
1215
- uses: actions/checkout@v4
1316

@@ -25,6 +28,4 @@ jobs:
2528
run: npm run build
2629

2730
- name: Publish
28-
run: npm publish
29-
env:
30-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)