Skip to content

Commit 8b77667

Browse files
authored
fix(ci): use generated ADC for Vertex recordings (#6425)
## Summary Vertex recording now uses the short-lived ADC file created by `google-github-actions/auth` instead of the unrelated `GOOGLE_APPLICATION_CREDENTIALS` repository secret. Fork PRs fail the Vertex matrix entry before checkout with a clear message. The workflow still does not authenticate fork code against Google Cloud. ## Testing - `bash -n scripts/integration-tests.sh` - `uv run pre-commit run --files .github/workflows/record-integration-tests.yml` A trusted-branch Vertex recording dispatch is still needed to prove the full credential flow and recordings artifact upload. ## Sensitive CI/auth check - Contract: trusted runs inherit the auth action's generated ADC file; fork Vertex runs stop before any Google auth. - CI / merge queue: triggers, permissions, `pull_request` model, and existing fork guard are unchanged. - Security: no static credential secret was added or logged. Signed-off-by: Sumanth Kamenani <skamenan@redhat.com>
1 parent ba58eb1 commit 8b77667

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/record-integration-tests.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ jobs:
258258
echo "Skipping provider: $CURRENT"
259259
fi
260260
261+
- name: Reject Vertex AI recording for fork PRs
262+
if: steps.should_run.outputs.run == 'true' && matrix.provider.setup == 'vertexai' && needs.compute-pr-info.outputs.is_fork_pr == 'true'
263+
run: |
264+
echo "::error::Failed to record with Vertex AI because Google Cloud authentication is intentionally unavailable for fork PRs. Push the commit to a branch in ogx-ai/ogx and dispatch the workflow from that branch."
265+
exit 1
266+
261267
- name: Checkout PR code
262268
if: steps.should_run.outputs.run == 'true'
263269
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -267,11 +273,13 @@ jobs:
267273
fetch-depth: 0
268274

269275
- name: Authenticate to Google Cloud (Vertex AI)
276+
id: vertex_auth
270277
if: steps.should_run.outputs.run == 'true' && matrix.provider.setup == 'vertexai' && needs.compute-pr-info.outputs.is_fork_pr != 'true'
271278
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
272279
with:
273280
project_id: ${{ secrets.VERTEX_AI_PROJECT }}
274281
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
282+
create_credentials_file: true
275283

276284
- name: Setup test environment
277285
if: steps.should_run.outputs.run == 'true'
@@ -319,7 +327,7 @@ jobs:
319327
WATSONX_PROJECT_ID: ${{ matrix.provider.setup == 'watsonx' && secrets.WATSONX_PROJECT_ID || '' }}
320328
VERTEX_AI_PROJECT: ${{ matrix.provider.setup == 'vertexai' && secrets.VERTEX_AI_PROJECT || '' }}
321329
VERTEX_AI_LOCATION: ${{ matrix.provider.setup == 'vertexai' && 'global' || '' }}
322-
GOOGLE_APPLICATION_CREDENTIALS: ${{ matrix.provider.setup == 'vertexai' && secrets.GOOGLE_APPLICATION_CREDENTIALS || '' }}
330+
GOOGLE_APPLICATION_CREDENTIALS: ${{ matrix.provider.setup == 'vertexai' && steps.vertex_auth.outputs.credentials_file_path || '' }}
323331
GEMINI_API_KEY: ${{ matrix.provider.setup == 'gemini' && secrets.GEMINI_API_KEY || '' }}
324332
TAVILY_SEARCH_API_KEY: ${{ contains(fromJSON('["gpt","azure","vertexai"]'), matrix.provider.setup) && secrets.TAVILY_SEARCH_API_KEY || '' }}
325333
AWS_BEDROCK_BEARER_TOKEN: ${{ matrix.provider.setup == 'bedrock' && secrets.AWS_BEARER_TOKEN_BEDROCK || '' }}

0 commit comments

Comments
 (0)