Skip to content

Commit 143ecc3

Browse files
ci: enable OIDC trusted publishing for npm
Configure GitHub Actions workflow to use OIDC authentication instead of NPM_TOKEN for publishing packages. This provides better security by eliminating long-lived secrets and enables automatic provenance attestation. Changes: - Add publish environment and id-token: write permission - Remove NPM_TOKEN from workflow configuration - Keep GITHUB_TOKEN for git operations Ticket: VL-3686
1 parent 62cb38d commit 143ecc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
publish:
1313
name: Publish Release
1414
runs-on: ubuntu-latest
15+
environment: publish
16+
permissions:
17+
id-token: write
18+
contents: read
1519

1620
steps:
1721
- name: Checkout repository
@@ -55,9 +59,6 @@ jobs:
5559
run: |
5660
echo "workspaces-update = false" >> .npmrc
5761
echo "@bitgo:registry=https://registry.npmjs.org" >> .npmrc
58-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
59-
env:
60-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6162
6263
- name: Install Packages
6364
run: npm ci --workspaces --include-workspace-root
@@ -72,4 +73,3 @@ jobs:
7273
run: npx lerna publish --yes --no-verify-access
7374
env:
7475
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)