Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 24f4686

Browse files
committed
[gha] fix artifactregistry login
1 parent a882a34 commit 24f4686

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,40 @@ on:
55
branches:
66
- main
77
pull_request:
8-
branches:
9-
- main
8+
9+
permissions:
10+
contents: read
11+
id-token: write #required for GCP Workload Identity federation which we use to login into Google Artifact Registry
12+
1013

1114
jobs:
1215
lint:
1316
runs-on: ubuntu-latest
1417

1518
steps:
1619
- uses: actions/checkout@v4
20+
1721
- uses: pnpm/action-setup@v4
1822
with:
1923
version: 9.15.1
24+
2025
- uses: actions/setup-node@v4
2126
with:
2227
node-version: '23'
2328
cache: 'pnpm'
2429
registry-url: "https://registry.npmjs.org"
25-
- run: pnpm install --frozen-lockfile
30+
31+
- name: Authenticate to Google Cloud
32+
uses: google-github-actions/auth@v2
33+
with:
34+
workload_identity_provider: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
35+
service_account: ${{ vars.GCP_SERVICE_ACCOUNT_EMAIL }}
36+
create_credentials_file: true # This exports the GOOGLE_APPLICATION_CREDENTIALS env var which is commonly used by CLIs
37+
38+
- name: Login to GCP Artifact Registry
39+
run: pnpm artifactregistry-login
40+
41+
- name: Install Dependencies
42+
run: pnpm install --frozen-lockfile
43+
2644
- run: pnpm lint

0 commit comments

Comments
 (0)