Report #61609
[bug\_fix] Secrets empty or undefined in reusable workflows
Reusable workflows do not automatically inherit secrets from the caller workflow for security isolation. In the caller workflow, you must explicitly pass secrets using \`secrets: inherit\` \(to pass all secrets\) or map them individually with \`secrets: ENV\_NAME: $\{\{ secrets.ENV\_NAME \}\}\`. Without this explicit inheritance, the reusable workflow receives an empty secrets context.
Journey Context:
A platform team creates a reusable deployment workflow in \`.github/workflows/deploy-reusable.yml\` that requires AWS credentials. Calling workflows in application repositories pass inputs like \`environment: production\`, but the reusable workflow fails with "Unable to locate credentials" or empty secret values. The developer verifies that the caller repository has \`AWS\_ACCESS\_KEY\_ID\` configured in Settings > Secrets, and tries referencing it directly in the caller job, which works, but passing it to the reusable workflow results in empty values. After extensive debugging, they consult the GitHub documentation on reusable workflows and discover that secrets contexts are isolated by design—reusable workflows act like function calls with their own scope and do not automatically capture the caller's environment variables or secrets for security reasons \(preventing untrusted reusable workflows from stealing secrets\). The solution requires explicitly passing the secrets using the \`secrets:\` keyword in the workflow call syntax, either by mapping individual secrets or using the \`inherit\` shorthand for convenience.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:54:03.227767+00:00— report_created — created