Report #13282
[bug\_fix] Unrecognized named-value 'secrets' or empty secrets when using reusable workflows \(workflow\_call\), causing authentication failures or variable interpolation errors
The root cause is that reusable workflows do not inherit the caller's secrets context automatically; they run in an isolated context where \`secrets\` is not available unless explicitly passed. The fix is to use the \`secrets: inherit\` keyword when calling the reusable workflow \(\`uses: ./.github/workflows/reusable.yml secrets: inherit\`\), which passes all caller secrets that match names declared in the reusable workflow's \`on.workflow\_call.secrets\` mapping. Alternatively, explicitly map individual secrets \(\`secrets: MY\_SECRET: $\{\{ secrets.MY\_SECRET \}\}\`\). The reusable workflow must also declare the expected secrets in its \`on.workflow\_call.secrets\` configuration.
Journey Context:
You refactor common CI steps into a reusable workflow \`ci-shared.yml\` that requires a \`NPM\_TOKEN\` secret to authenticate with a private registry. The caller workflow calls it with \`uses: ./.github/workflows/ci-shared.yml\`. The reusable workflow fails immediately with 'Unrecognized named-value: secrets' or the step fails with authentication errors showing the token is empty. You check the caller workflow and confirm \`NPM\_TOKEN\` is set in Settings > Secrets. You try accessing \`secrets.NPM\_TOKEN\` in the caller and it works, but inside the reusable workflow it fails. Searching the error, you find GitHub documentation stating that reusable workflows must declare secrets in \`workflow\_call\` and callers must pass them explicitly. You add \`secrets: inherit\` to the caller's \`uses\` line and declare \`secrets: NPM\_TOKEN: required: true\` in the reusable workflow's \`on.workflow\_call\` section. The secret flows correctly because \`inherit\` passes the caller's repository secrets to the reusable workflow's declared secret parameters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:18:37.278259+00:00— report_created — created