GitHub Actions OIDC "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL"
By Kaveh Alemi·Latchkey
The OIDC token environment variables are only injected when the job has id-token: write. Without that permission the request URL is unset.
What this error means
A cloud-login or OIDC step fails saying it cannot get ACTIONS_ID_TOKEN_REQUEST_URL or the related env var is empty.
github-actions
Error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable
Diagnose it: what token do you actually have?
Permission failures in Actions are almost never about your repository settings alone. Three things combine: the default GITHUB_TOKEN permission set for the repo or organization, the permissions: block in the workflow, and whether the event is a fork pull request, which downgrades the token to read-only regardless of everything else.
OIDC tokens require id-token: write; without it the runtime does not set the request URL.
Permission set at the wrong scope
Granting id-token only at workflow level but overriding job permissions can drop it for the job.
How to fix it
Grant id-token write to the job
Add permissions: id-token: write to the job using OIDC.
Keep contents: read alongside it if needed.
.github/workflows/ci.yml
permissions:id-token:writecontents:read
Grant the narrowest permission that works
Declaring a permissions: block switches the job from the repository default to exactly what you list, so an incomplete block is a common cause of a new failure right after someone tightened security. List every scope the job needs, not just the one that failed.
.github/workflows/ci.yml
permissions:contents:read # checkoutpackages:write # push to GHCRid-token:write # OIDC to a cloud providerpull-requests:write # comment on or label a PRchecks:write # publish check runs
How to prevent it
Add id-token: write to every job that uses cloud OIDC login.
Be careful that job-level permissions do not drop the inherited id-token scope.
Frequently asked questions
What causes GitHub Actions OIDC "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL"?
There are 2 common causes: id-token permission not granted and permission set at the wrong scope. OIDC tokens require id-token: write; without it the runtime does not set the request URL.
How do I fix GitHub Actions OIDC "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL"?
Grant id-token write to the job. Add permissions: id-token: write to the job using OIDC.
What does GitHub Actions OIDC "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL" actually mean?
A cloud-login or OIDC step fails saying it cannot get ACTIONS_ID_TOKEN_REQUEST_URL or the related env var is empty.
How do I stop GitHub Actions OIDC "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL" happening again?
Add id-token: write to every job that uses cloud OIDC login. The prevention section lists 2 changes that keep it from recurring.