Skip to main content
GitHub Actions can issue a signed OIDC token to each workflow job. Reducto verifies the token and returns a short-lived access token, so your repository needs no REDUCTO_API_KEY secret.

Get a token in a workflow

Grant the job permission to request an OIDC token:
id-token: write lets the job request a token. It grants no write access to the repository. actions/checkout needs contents: read. GitHub exposes ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN to the job. Request a token with the audience you will configure in Reducto. URL-encode the audience:

Inspect the token

A decoded GitHub Actions token looks like this:
The claims you are most likely to match on: See GitHub’s OIDC reference for all claims and sub formats. GitHub tokens expire after about 5 minutes.

Configure Reducto

In Studio, open Settings > Workload identity and create a provider with the GitHub Actions preset: Add a mapping for the workflow you trust. This mapping allows only the production deploy workflow on main in acme/payments: To allow every workflow and branch in one repository, use a single condition sub = repo:acme/payments:*.

Call Reducto from the workflow

Store the provider ID as a repository or organization variable, not a secret. It identifies the provider but grants nothing by itself.
The token provider requests a GitHub token each time the SDK needs a new access token.
github_actions_token_provider(audience=...) in Python and githubActionsTokenProvider({ audience }) in Node.js set the audience. It defaults to https://platform.reducto.ai.

GitHub Actions best practices

  • Use GitHub environments with required reviewers or branch rules for production, and match the environment claim.
  • Match repository_id or repository and a ref or workflow_ref, not only repository_owner. An owner-wide mapping lets every repository in the organization call Reducto.
  • Do not give mappings to workflows that run on pull_request_target or on pull requests from forks. They can run untrusted code.
  • Use separate mappings for CI and for deploy workflows.
  • Remove REDUCTO_API_KEY from repository and organization secrets once federation works.
  • Review mappings when you rename or transfer a repository.