Skip to content

Commit abcb31a

Browse files
authored
Chore: Use vault to get npm token (#145)
1 parent d6d2862 commit abcb31a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/publish-npm.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
permissions:
1414
contents: read
1515
packages: write
16+
# id-token: write required for get-vault-secrets
17+
id-token: write
1618
outputs:
1719
new_version: ${{ steps.version_check.outputs.version }}
1820
version_changed: ${{ steps.version_check.outputs.changed }}
@@ -52,11 +54,18 @@ jobs:
5254
if: steps.version_check.outputs.changed == 'true'
5355
run: yarn build
5456

57+
- name: Get secrets from vault
58+
id: get-secrets
59+
uses: grafana/shared-workflows/actions/get-vault-secrets@main
60+
with:
61+
repo_secrets: |
62+
NPM_TOKEN=npm-release.npm_token
63+
5564
- name: Publish package to NPM
5665
if: steps.version_check.outputs.changed == 'true'
5766
run: npm publish --access public --scope grafana
5867
env:
59-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68+
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
6069

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

0 commit comments

Comments
 (0)