Build a GitHub Actions composite action that wraps OIDC credential exchange, caches the token in workflow-level outputs, and is consumed by multiple jobs without re-authenticating

domain: GitHub Actions · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create an action.yml in a shared repository defining a composite action with inputs for cloud provider, role ARN, and session duration; add a step that calls the cloud OIDC token exchange action and sets the resulting credentials as step outputs
  2. In the composite action, write the credentials to GITHUB_OUTPUT so callers can reference them via needs.<job>.outputs or steps.<id>.outputs
  3. Reference the composite action from a reusable workflow using uses: org/repo/path@ref and pass required inputs; propagate outputs back through the workflow_call outputs block
  4. In the consuming workflow, set permissions: id-token: write at the job level and pass environment inputs so the composite action can select the correct role per environment
  5. Add an OIDC audience override input so the same composite action can target AWS, GCP, and Azure endpoints by varying the audience claim without forking
  6. Test that token expiry is handled by wrapping downstream steps in a retry composite step and verifying that a re-auth step fires when the cloud SDK reports expired credentials

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
Exchange a GitHub Actions OIDC token for AWS credentials using AssumeRoleWithWebIdentity
docs.aws.amazon.com · 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