GitHub Actions secrets: inherit not reaching a nested reusable workflow in CI
When workflows are nested, secrets: inherit passes the current context down one level. A middle workflow that does not itself inherit or forward secrets breaks the chain, so the deepest workflow sees nothing.
What this error means
The top caller inherits secrets and the first-level workflow works, but a second-level reusable workflow reports a secret as empty or not found.
Error: Secret DEPLOY_TOKEN not found in "./.github/workflows/inner.yml".
The middle workflow "outer.yml" did not forward secrets to "inner.yml".Common causes
A middle workflow does not forward secrets
The outer reusable workflow received secrets via inherit, but its own call to the inner workflow has no secrets: inherit or explicit map, so the chain breaks.
Mixing inherit with explicit across levels
One level inherits while another expects explicit named secrets that were never mapped, leaving gaps in the chain.
How to fix it
Inherit at every level of the chain
- Add secrets: inherit to each nested call, not just the top one.
- Verify every workflow that calls another forwards secrets.
- Re-run and confirm the deepest workflow receives the secret.
# outer.yml calling inner.yml
jobs:
inner:
uses: ./.github/workflows/inner.yml
secrets: inheritForward specific secrets explicitly at each level
If you avoid inherit, declare and map the secret at every level so it propagates fully.
secrets:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}How to prevent it
- Add secrets: inherit (or explicit maps) at every nesting level.
- Keep the secret-passing strategy consistent through the chain.
- Keep nesting shallow so secret propagation is easy to reason about.