Skip to content

Commit af61ac3

Browse files
committed
Move npm token to vault
1 parent 6aef3d2 commit af61ac3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/publish-npm.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ jobs:
88
publish:
99
name: Publish to NPM & GitHub Package Registry
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
packages: write
1115
steps:
16+
- id: get-secrets
17+
uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760 # get-vault-secrets-v1.1.0
18+
with:
19+
repo_secrets: |
20+
NPM_TOKEN=npm_token:npm_token
21+
1222
- name: Checkout repository
1323
uses: actions/checkout@v4
1424
with:
@@ -40,7 +50,7 @@ jobs:
4050
if: steps.version_check.outputs.changed == 'true'
4151
run: npm publish --access public
4252
env:
43-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
4454

4555
- name: Setup .npmrc file for GitHub Packages
4656
if: steps.version_check.outputs.changed == 'true'

0 commit comments

Comments
 (0)