Skip to content

Commit eab1d97

Browse files
author
mdheller
committed
ci: temporary WIF smoke test (to be deleted)
1 parent 012da20 commit eab1d97

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/wif-smoke.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: wif-smoke
2+
on: push
3+
permissions:
4+
id-token: write
5+
contents: read
6+
jobs:
7+
smoke:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- id: auth
12+
uses: google-github-actions/auth@v2
13+
with:
14+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
15+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
16+
token_format: access_token
17+
- name: prove OIDC->sourceos-ci impersonation + GAR read (write role implies read)
18+
run: |
19+
T="${{ steps.auth.outputs.access_token }}"
20+
test -n "$T" && echo "token minted: OK"
21+
echo "identity:"; curl -s "https://oauth2.googleapis.com/tokeninfo?access_token=$T" | tr ',' '\n' | grep -iE '"email"|"issued_to"' || true
22+
code=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $T" \
23+
"https://artifactregistry.googleapis.com/v1/projects/socioprophet-platform/locations/us-central1/repositories/socioprophet")
24+
echo "GAR repo GET http=$code"; test "$code" = "200"

0 commit comments

Comments
 (0)