File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments