GitHub Actions "input ... is not defined in the referenced workflow" in CI
A caller may only pass inputs that the reusable workflow declares under on.workflow_call.inputs. Passing an undeclared key in with: is rejected as an invalid input.
What this error means
The caller fails with "invalid input, X is not defined in the referenced workflow" or "Unexpected input(s) X". The with: key does not match any declared input name.
GitHub Actions
Invalid workflow file: .github/workflows/ci.yml#L10
invalid value workflow reference: input "enviroment" is not defined
in the referenced workflow "./.github/workflows/deploy.yml".Common causes
A typo in the input name
The caller passes enviroment but the workflow declares environment. Input names must match exactly.
The input was never declared in the callee
You added a with: key in the caller without adding the matching entry under the called workflow's workflow_call.inputs.
How to fix it
Declare the input in the reusable workflow
- Open the called workflow and add the input under workflow_call.inputs.
- Give it a type (string, boolean, or number) and required flag.
- Match the caller with: key to the declared name exactly.
.github/workflows/deploy.yml
on:
workflow_call:
inputs:
environment:
required: true
type: stringFix the caller with: key
Correct the spelling so the passed key matches a declared input.
.github/workflows/ci.yml
with:
environment: productionHow to prevent it
- Keep caller with: keys and callee input names in sync.
- Declare every input the caller passes under workflow_call.inputs.
- Review the reusable workflow inputs list when adding a new with: key.
Related guides
GitHub Actions "required input ... not provided" for a reusable workflow in CIFix "input X is required and must be provided" when calling a reusable workflow in CI - the callee marks an i…
GitHub Actions reusable workflow input type mismatch in CIFix a reusable-workflow input type error in CI - the value passed in with: does not match the declared type (…
GitHub Actions reusable workflow with no workflow_call trigger in CIFix a reusable-workflow call that fails because the called workflow has no on: workflow_call trigger in CI -…