How do permissions flow into a reusable workflow?
AdvancedConceptCustom Actions & Reusable Workflows
Answer
The called workflow's GITHUB_TOKEN gets the caller job's permissions as a ceiling. The called workflow can only keep or reduce them in its own permissions block; it cannot elevate. So if the reusable deploy needs id-token: write, the caller job must grant it:
jobs:
deploy:
permissions:
contents: read
id-token: write
uses: ./.github/workflows/deploy.yml
Missing this shows up as Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable inside the called workflow, or as the run failing to start with a permissions error.
More on Custom Actions & Reusable Workflows
What are the three kinds of custom action and how do you choose?BeginnerWrite a minimal composite action that installs Node and dependencies with caching.IntermediateWhat can a composite action not do compared to a job?IntermediateHow do you pass outputs out of a composite action?IntermediateWhat does `action.yml` contain for a JavaScript action?IntermediateWhy must a JavaScript action commit its `dist/` or `node_modules`?Intermediate