File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 4141 needs : ci
4242 runs-on : ubuntu-latest
4343 timeout-minutes : 10
44+ permissions :
45+ contents : read
46+ id-token : write
4447 env :
4548 CI : true
4649 steps :
5558 run : npm ci
5659 - name : Build
5760 run : npm run build --if-present
61+ - uses : google-github-actions/auth@v2
62+ with :
63+ workload_identity_provider : ' projects/457105351064/locations/global/workloadIdentityPools/github-secrets-pool/providers/github-secrets-github'
64+ - uses : google-github-actions/setup-gcloud@v2
65+ - name : Get NPM token
66+ id : npm-token
67+ run : |
68+ token=$(gcloud secrets versions access latest --secret=npm-token --project=gcp-github-secrets)
69+ echo "::add-mask::$token"
70+ echo "token=$token" >> "$GITHUB_OUTPUT"
5871 - name : Publish ${{ github.ref }}
5972 run : npm publish
6073 env :
61- NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN }}
74+ NODE_AUTH_TOKEN : ${{ steps.npm-token.outputs.token }}
You can’t perform that action at this time.
0 commit comments