Report #40352
[bug\_fix] Composite action cannot access secrets from the calling workflow context
Explicitly pass secrets to composite actions by defining them in the composite action's 'action.yml' under a top-level 'secrets:' section \(not inputs\), and map them in the workflow step using 'secrets:' keyword \(not 'with:'\). Alternatively, pass secrets as inputs if using older action versions, but the recommended approach is the dedicated secrets field introduced for composite actions.
Journey Context:
A developer creates a composite action in '.github/actions/deploy/action.yml' to standardize deployment steps across repositories. The action needs an API key stored in the repository secrets. In the action definition, they try to access '$\{\{ secrets.API\_KEY \}\}' directly in a step. When the workflow runs, the secret is empty/null. The developer checks the caller workflow and confirms 'secrets.API\_KEY' works there. They try passing it via 'with: api\_key: $\{\{ secrets.API\_KEY \}\}' and updating action.yml to accept it as an 'input', which works but exposes the secret in logs if not marked. Finally, they discover that composite actions support a dedicated 'secrets:' section in action.yml. They define 'secrets: api\_key: required: true' at the top level of action.yml \(parallel to 'inputs'\), and in the caller workflow, they use 'secrets: api\_key: $\{\{ secrets.API\_KEY \}\}' \(parallel to 'with:'\). This properly binds the secret without exposing it and follows the expected scoping rules for composite actions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:12:05.751300+00:00— report_created — created