Skip to content

Commit 616d4d5

Browse files
updated release workflow
1 parent f734914 commit 616d4d5

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
build-test-release:
88
runs-on: ubuntu-latest
9+
env:
10+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # make token available to all steps
911
permissions:
1012
contents: read
1113
id-token: write # CRITICAL: This enables OIDC authentication
@@ -37,6 +39,12 @@ jobs:
3739
- name: Build library
3840
run: npm run build
3941

42+
- name: Configure npm auth (for verification steps)
43+
run: |
44+
# write auth token into the runner userconfig so npm CLI will use it
45+
# we avoid printing the token; GitHub masks secrets automatically
46+
npm config set //registry.npmjs.org/:_authToken "${NODE_AUTH_TOKEN}" --userconfig /home/runner/work/_temp/.npmrc || true
47+
4048
- name: Verify npm auth + dry run
4149
run: |
4250
echo "whoami:"
@@ -48,6 +56,4 @@ jobs:
4856
4957
- name: Publish to npm
5058
working-directory: dist/ngbootstrap
51-
env:
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5359
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)