Interview Prep/GitHub Actions/Custom Actions & Reusable Workflows

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Custom Actions & Reusable Workflows