---
name: "gcp-workload-identity-federation"
description: "Authenticate GitHub Actions to Google Cloud securely without managing permanent service account keys."
metadata:
  author: "Google Cloud Platform"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup gcp workload identity github actions"
  - "eliminate gcp service account key"
  - "configure wif gcp"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# GCP Workload Identity Federation with GitHub Actions

Configures GCP Workload Identity Federation (WIF): creating Workload Identity Pools and Providers, configuring attribute condition mappings (repository matching), and acquiring short-lived GCP tokens in CI.

## When to Invoke
Invoke this skill whenever you need to:
- setup gcp workload identity github actions
- eliminate gcp service account key
- configure wif gcp

## Execution SOP & Rules
1. Create Workload Identity Pool and OIDC Provider linked to https://token.actions.githubusercontent.com.
2. Map attributes: google.subject=assertion.sub, attribute.repository=assertion.repository.
3. Bind IAM role WorkloadIdentityUser on service account to principalSet matching repository.
4. In GitHub Actions: use google-github-actions/auth@v2 specifying workload_identity_provider and service_account.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
