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:
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.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
environmentclaim. - Match
repository_idorrepositoryand areforworkflow_ref, not onlyrepository_owner. An owner-wide mapping lets every repository in the organization call Reducto. - Do not give mappings to workflows that run on
pull_request_targetor on pull requests from forks. They can run untrusted code. - Use separate mappings for CI and for deploy workflows.
- Remove
REDUCTO_API_KEYfrom repository and organization secrets once federation works. - Review mappings when you rename or transfer a repository.