Skip to content

Commit 4403544

Browse files
committed
Allow WIF auth fallback in PR workflow
1 parent 22df258 commit 4403544

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ jobs:
6060
with:
6161
python-version: "3.12"
6262
- name: Auth
63+
if: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' && secrets.GCP_DEPLOY_SERVICE_ACCOUNT != '' }}
64+
uses: google-github-actions/auth@v2
65+
with:
66+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
67+
service_account: ${{ secrets.GCP_DEPLOY_SERVICE_ACCOUNT }}
68+
- name: Auth (fallback)
69+
if: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER == '' || secrets.GCP_DEPLOY_SERVICE_ACCOUNT == '' }}
6370
uses: google-github-actions/auth@v2
6471
with:
6572
credentials_json: ${{ secrets.GCP_SA_KEY }}
@@ -89,6 +96,13 @@ jobs:
8996
- name: Start Redis
9097
run: sudo systemctl start redis-server
9198
- name: Auth
99+
if: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' && secrets.GCP_DEPLOY_SERVICE_ACCOUNT != '' }}
100+
uses: google-github-actions/auth@v2
101+
with:
102+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
103+
service_account: ${{ secrets.GCP_DEPLOY_SERVICE_ACCOUNT }}
104+
- name: Auth (fallback)
105+
if: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER == '' || secrets.GCP_DEPLOY_SERVICE_ACCOUNT == '' }}
92106
uses: google-github-actions/auth@v2
93107
with:
94108
credentials_json: ${{ secrets.GCP_SA_KEY }}

0 commit comments

Comments
 (0)