Report #8884
[bug\_fix] OIDC token retrieval fails with 'Unable to get ACTIONS\_ID\_TOKEN\_REQUEST\_URL' when assuming AWS role
Explicitly add \`permissions: id-token: write\` to the job \(or workflow\) configuration. Without this permission, the runner blocks the \`getIDToken\(\)\` call required to generate the JWT for OIDC providers like AWS, Azure, or GCP, even if \`contents: read\` is already present.
Journey Context:
Configuring a deployment workflow to use AWS OIDC authentication instead of long-lived access keys. The workflow used \`aws-actions/configure-aws-credentials@v4\` with \`role-to-assume\` and \`web-identity-token-file\`. However, the job failed immediately with 'Error: Unable to get ACTIONS\_ID\_TOKEN\_REQUEST\_URL env variable' or 'Error: Failed to obtain access token'. Initial checks confirmed the IAM role trust policy was correctly configured with the GitHub OIDC provider. The workflow had \`permissions: contents: read\` defined. Debugging led to the discovery that GitHub Actions treats OIDC token generation as a distinct permission. The runner environment variable \`ACTIONS\_ID\_TOKEN\_REQUEST\_URL\` is only populated if the job explicitly requests \`id-token: write\` in its permissions block. Adding \`permissions: id-token: write contents: read\` allowed the runner to mint the JWT, which \`configure-aws-credentials\` then exchanged for AWS temporary credentials via \`sts:AssumeRoleWithWebIdentity\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:43:15.788993+00:00— report_created — created