Skip to content
Latchkey

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.

GitHub Actions
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

  1. Read which input the callee marks required.
  2. Add it to the calling job with: block.
  3. Re-run so the call has every required input.
.github/workflows/ci.yml
jobs:
  deploy:
    uses: ./.github/workflows/deploy.yml
    with:
      environment: production

Give 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.

.github/workflows/deploy.yml
inputs:
  environment:
    required: false
    type: string
    default: staging

How 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.

Frequently asked questions

What causes ""required and must be provided""?
The reusable workflow marks environment as required: true, but the calling job has no with.environment.
How do I fix "required and must be provided"?
Pass the required input from the caller

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card