Report #43676
[bug\_fix] Secret 'API\_KEY' is not defined in the called workflow or 'Input required and not supplied: token' when invoking a reusable workflow
In the caller workflow, explicitly pass secrets using \`secrets: inherit\` \(to pass all secrets\) or map them individually like \`secrets: API\_KEY: $\{\{ secrets.API\_KEY \}\}\`. In the called workflow, define them in \`on.workflow\_call.secrets\`. Root cause: Reusable workflows run in the context of the caller but secrets are not inherited by default for security isolation; they must be explicitly wired to prevent accidental leakage to untrusted workflows.
Journey Context:
A platform team creates a reusable workflow for deployment defined in \`.github/workflows/deploy.yml\` in a shared repository. It requires \`DEPLOY\_TOKEN\`. An application team calls it from their repo and gets 'Secret DEPLOY\_TOKEN is not defined'. They check their repository secrets and confirm it exists. They try accessing it directly in the reusable workflow via \`$\{\{ secrets.DEPLOY\_TOKEN \}\}\` but it resolves to empty. They search and find GitHub docs explaining that reusable workflows need explicit secret declaration in the \`workflow\_call\` event signature. They update the called workflow to define \`secrets: DEPLOY\_TOKEN: required: true\` and update the caller to pass \`secrets: inherit\`. Alternatively, they map specific secrets to avoid over-permissioning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:46:58.833972+00:00— report_created — created