GitHub Actions "inputs" not available in job-level if before uses in CI
The inputs context belongs to the called workflow, not the caller. A calling job's if: runs in the caller, so ${{ inputs.x }} there is undefined unless the caller itself was triggered by workflow_call or workflow_dispatch with those inputs.
What this error means
A job-level if: on a calling job fails to parse with "Unrecognized named-value: 'inputs'", or silently evaluates to false because inputs is empty in the caller.
Invalid workflow file: .github/workflows/ci.yml#L11
Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.deploy
The inputs context is not available in the caller's job-level "if".Common causes
Reading callee inputs from the caller
You guarded the calling job with if: inputs.deploy == true, but those inputs exist inside the reusable workflow, not in the caller that invokes it.
The caller has no matching inputs context
Unless the caller is itself triggered by workflow_call or workflow_dispatch that defines deploy, the caller's inputs context is empty.
How to fix it
Guard the call with caller-side context
- Use github, vars, or an upstream needs.*.outputs value in the calling job if.
- Pass the decision into the reusable workflow as an input.
- Move any inputs-based condition inside the called workflow jobs.
jobs:
deploy:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/deploy.yml
with:
run_deploy: trueCondition inside the reusable workflow
Let the called workflow decide with its own inputs context on its jobs or steps.
# in deploy.yml
jobs:
run:
if: ${{ inputs.run_deploy }}
runs-on: ubuntu-latestHow to prevent it
- Remember inputs belongs to the callee, not the calling job.
- Guard calling jobs with github, vars, or needs outputs.
- Put inputs-based conditions inside the reusable workflow.