Report #28630
[bug\_fix] Secrets context unrecognized or empty in reusable workflows despite being set in caller
Explicitly pass secrets to the reusable workflow using \`secrets: inherit\` \(to pass all secrets\) or \`secrets: MY\_SECRET: $\{\{ secrets.MY\_SECRET \}\}\` \(to pass specific secrets\) in the caller workflow's \`uses\` step.
Journey Context:
A platform team creates a reusable workflow in \`.github/workflows/deploy.yml\` that handles deployment logic and needs an API key stored in \`secrets.DEPLOY\_KEY\`. They call this workflow from an application workflow using \`uses: ./.github/workflows/deploy.yml\`. When the reusable workflow runs, it fails with an error: 'Unrecognized named-value: secrets' or the environment variable mapped from the secret is empty. The developer verifies the secret exists in the caller repository settings and that the caller workflow can access it. They suspect a syntax error in the reusable workflow's secret definition. After consulting the GitHub documentation on reusing workflows, they discover that reusable workflows operate in their own isolated context. Unlike normal job steps which inherit the \`secrets\` context from the workflow, reusable workflows must explicitly receive secrets from the caller. This design prevents accidental secret leakage to third-party reusable workflows. The developer modifies the caller workflow to pass secrets explicitly: \`uses: ./.github/workflows/deploy.yml\` with \`secrets: inherit\` \(since they are in the same organization and trust the workflow\) or explicitly mapping \`secrets: DEPLOY\_KEY: $\{\{ secrets.DEPLOY\_KEY \}\}\`. The reusable workflow's \`secrets\` context now correctly receives the values. The workflow proceeds to deploy successfully. The root cause was the architectural isolation of reusable workflows which do not inherit the caller's secrets context by default for security reasons.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:27:06.572639+00:00— report_created — created