GitHub Actions "required input ... not provided" for a reusable workflow in CI
A reusable-workflow input declared required: true must be supplied by every caller. If the caller's with: block omits it, the call fails before any job runs.
What this error means
The caller fails with "input X is required and must be provided" or "missing required input". The reusable workflow declares that input as required.
Invalid workflow file: .github/workflows/ci.yml#L8
input "environment" is required and must be provided by the caller
of "./.github/workflows/deploy.yml".Common causes
The caller omitted a required input
The reusable workflow marks environment as required: true, but the calling job has no with.environment.
A default was expected but not set
You assumed the input had a default; a required input has no default, so the caller must always pass it.
How to fix it
Pass the required input from the caller
- Read which input the callee marks required.
- Add it to the calling job with: block.
- Re-run so the call has every required input.
jobs:
deploy:
uses: ./.github/workflows/deploy.yml
with:
environment: productionGive the input a default if it is optional
If most callers use the same value, make the input optional with a default in the reusable workflow instead of required.
inputs:
environment:
required: false
type: string
default: stagingHow to prevent it
- Document required inputs in the reusable workflow header.
- Give sensible defaults to inputs that are usually the same.
- Add a caller template so required inputs are always present.