Use when validating GitHub Actions workflows for Google Cloud and Vertex AI deployments. Trigger with phrases like "validate github actions", "setup workload identity federation", "github actions security", "deploy agent with ci/cd", or "automate vertex ai deployment". Enforces Workload Identity Federation (WIF), validates OIDC permissions, ensures least privilege IAM, and implements security best practices.
This skill is limited to using the following tools:
scripts/setup-wif.shscripts/validate-workflow.shBefore using this skill, ensure:
Secure Workflow Template:
# {baseDir}/.github/workflows/deploy-vertex-ai.yml
name: Deploy Vertex AI Agent
on:
push:
branches: [main]
paths: ['agent/**']
permissions:
contents: read
id-token: write # REQUIRED for WIF
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Authenticate to GCP (WIF)
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
- name: Deploy to Vertex AI
run: |
gcloud ai agents deploy \
--project=${{ secrets.GCP_PROJECT_ID }} \
--region=us-central1
- name: Validate Deployment
run: |
python scripts/validate-deployment.py
WIF Setup Commands:
# One-time WIF configuration
gcloud iam workload-identity-pools create github-pool \
--location=global \
--display-name="GitHub Actions Pool"
gcloud iam workload-identity-pools providers create-oidc github-provider \
--location=global \
--workload-identity-pool=github-pool \
--issuer-uri="https://token.actions.githubusercontent.com" \
--attribute-mapping="google.subject=assertion.sub,attribute.repository=assertion.repository"
Security Validation Checks:
# {baseDir}/.github/workflows/security-check.yml
name: Security Validation
on: [pull_request, push]
permissions:
contents: read
security-events: write
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for secrets
uses: trufflesecurity/trufflehog@main
- name: Vulnerability scan
uses: aquasecurity/trivy-action@master
- name: Validate no JSON keys
run: |
if find . -name "*service-account*.json"; then
echo "ERROR: Service account keys detected"
exit 1
fi
- name: Validate WIF usage
run: |
if grep -r "credentials_json" .github/workflows/; then
echo "ERROR: Use WIF instead of JSON keys"
exit 1
fi
WIF Authentication Failed
OIDC Token Error
id-token: write permission to workflowIAM Permission Denied
Attribute Condition Failed
Deployment Validation Failed