Use GitHub Actions OIDC id-token to authenticate to cloud providers without long-lived credentials

domain: docs.github.com/actions/security-for-github-actions/security-hardening-your-deployments · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Add `id-token: write` permission to the GitHub Actions job
  2. For AWS: configure an IAM OIDC identity provider with issuer `https://token.actions.githubusercontent.com` and create an IAM role with a trust policy that matches your repo's subject claim (`repo:<org>/<repo>:ref:refs/heads/main`)
  3. Use the official `aws-actions/configure-aws-credentials` action with `role-to-assume` to exchange the OIDC token for temporary AWS credentials
  4. For GCP: create a Workload Identity Pool and Provider; use `google-github-actions/auth` to exchange the token for a GCP access token
  5. Validate the assumed identity in your pipeline by calling the cloud provider's identity API and confirming the role/service account matches expectations

Known gotchas

Related routes

Authenticate GitHub Actions to AWS with OIDC (no stored keys)
github-actions · 4 steps · unrated
Authenticate a GitHub Actions workflow to Azure using OIDC federated credentials instead of a client secret
learn.microsoft.com · 5 steps · unrated
Configure GitHub Actions OIDC authentication to Google Cloud Platform with Workload Identity Federation, restricting token claims to a specific repository and branch
GitHub Actions · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans