GitHub Actions cannot get ACTIONS_ID_TOKEN_REQUEST_URL (OIDC token)
Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variableShort answer
The runner only sets ACTIONS_ID_TOKEN_REQUEST_URL when the job may request an OIDC token. Without id-token: write the token cannot be requested. Add it at workflow or job level, keep contents: read if you check out code, and for reusable workflows set it on the caller too.
Fix it fast
1Find out which cause you have
Show every permissions block in the workflow and note which job each one belongs to. The job that fails must be allowed to request the token.
grep -n -B1 -A6 'permissions:' .github/workflows/*.yml2Match what you see, then jump to its fix
- 1
No permissions block, or one that lists contents or pages but not id-tokenid-token: write is missingFix - 2
id-token: write sits in one job or at the top, but the failing job has a permissions block without itid-token is set at the wrong levelFix - 3
The deploy job lives in a called workflow owned by a different org or enterpriseThe job runs from a reusable workflow in another organizationFix
- 1
What does the error look like?
Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable
Cause 1 of 3
id-token: write is missing
1Check
The OIDC reference says that without id-token: write the token cannot be requested. Permissions you do not list are set to none once you write a permissions block.
grep -n 'id-token' .github/workflows/*.yml || echo missing2Fix
Add id-token: write to the job that needs the token (Pages deploy jobs need it, as do actions that log in to a cloud with OIDC). It only allows fetching the token; it grants no write access to repository content.
permissions:
contents: read
id-token: write
pages: write3Verify
Re-run the job; the variable error is gone.
gh run rerun --failedConfirmed by docs.github.com
Cause 2 of 3
id-token is set at the wrong level
1Check
permissions works as a top-level key for all jobs or inside a single job. Put the permission where the job that requests the token can use it.
grep -n -B3 -A6 'jobs:' .github/workflows/deploy.yml2Fix
Repeat id-token: write inside the job's permissions block.
jobs:
deploy:
permissions:
id-token: write
pages: write3Verify
Re-run the failing job; the token step passes.
gh run rerun --failedConfirmed by docs.github.com
Cause 3 of 3
The job runs from a reusable workflow in another organization
1Check
For reusable workflows in the same user, organization or enterprise the token is available from the caller's context. For one outside, the docs say to set id-token to write explicitly in the caller.
grep -n -B2 -A8 'uses: .*/.github/workflows' .github/workflows/*.yml2Fix
Set id-token: write on the caller workflow or the calling job.
jobs:
call:
permissions:
id-token: write
contents: read
uses: other-org/shared/.github/workflows/deploy.yml@main3Verify
Re-run the caller workflow.
gh run rerun --failedConfirmed by docs.github.com
How do I stop it coming back?
- Give id-token: write to the deploy job only, not the whole workflow.
- Copy the permissions block from the action's README when you add a new deploy action.
- Re-read permissions whenever a job gets its own permissions block.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
actions/configure-pages fails with 'Get Pages site failed'
Create Pages site failed
configure-pages asks GitHub for the repository's Pages site.
3 causes, each with a fixServers
Docker push to Artifact Registry fails from GitHub Actions with a permission error
Permission 'artifactregistry.repositories.uploadArtifacts' denied on resource
The identity your workflow authenticates as lacks the permission artifactregistry.repositories.uploadArtifacts on the target repository.
4 causes, each with a fixServers
docker pull or push to ghcr.io fails with 'denied'
Error response from daemon: denied
ghcr.io refuses a pull or push when Docker is not logged in, when the token lacks the package scope, or when the workflow's GITHUB_TOKEN has no packages permission or no access to that package.
4 causes, each with a fixServers
git says it could not read Username for https://github.com in a build or CI job
fatal: could not read Username for 'https://github.com': No such device or address
Git asked for HTTPS credentials and there was no terminal to ask on, so it gave up.
3 causes, each with a fixServers
upload-artifact fails because the artifact storage quota is full
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
Uploads fail when your account's shared artifact storage is used up.
3 causes, each with a fixServers
configure-aws-credentials says no OpenID Connect provider exists for GitHub
No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com
AWS has no IAM identity provider for GitHub's token issuer in the account that holds the role.
3 causes, each with a fix