Production Security

GitHub Actions OIDC Deployment Guide

Replace long-lived deployment keys with short-lived GitHub Actions OIDC credentials and tightly scoped trust conditions. Last updated September 19, 2026.

Replace long-lived deployment keys with short-lived GitHub Actions OIDC credentials and tightly scoped trust conditions. This reference is written for developers who need practical validation behavior, reviewable rules and safe examples rather than copied snippets with no explanation.

Recommended workflow

StepWhy it matters
Define the workload identityChoose the repository, branch, environment and workflow conditions that may deploy.
Create narrow trustBind token issuer, audience and subject claims to one deployment role.
Request minimum permissionsGrant id-token write only to the job that exchanges the token.
Prove denial pathsTest forks, pull requests and unapproved environments cannot assume the role.

Starter snippet

workflow identity -> OIDC token -> cloud trust policy -> short-lived role session

Review checks

Common mistakes

Validation should help users correct input while protecting systems from bad data. Keep syntax checks, product policy, security review and deliverability checks separate.

Related Formalint references

Continue with Github Actions Env Secrets Guide, Static Site Deployment Checklist, Deployment Rollback Checklist.