Skip to content

Commit 2cd9505

Browse files
author
Github Action
committed
File sync from domdomegg/domdomegg
1 parent 6598eae commit 2cd9505

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
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:
@@ -55,7 +58,17 @@ jobs:
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 }}

0 commit comments

Comments
 (0)