GitHub Actions composite action cannot define jobs or use in CI
A composite action is a bundle of steps, not a workflow. It declares runs.using: composite and runs.steps. It cannot define jobs:, on:, or workflow_call; those belong to workflows.
What this error means
Loading action.yml fails with an unexpected value or missing property error because it contains jobs:, on:, or a workflow-style structure instead of runs.steps.
Error: Unexpected value 'jobs'
# action.yml is a composite action and must use runs.steps, not jobsCommon causes
Workflow structure inside action.yml
The file was written like a workflow with jobs: and on:, but a composite action only supports name, inputs, outputs, and runs.
Confusing composite actions with reusable workflows
Reusable workflows have jobs and workflow_call; composite actions have steps. Mixing the two shapes fails validation.
How to fix it
Use runs.using composite with steps
- Replace jobs: with runs.using: composite and runs.steps.
- Move each step under runs.steps with a shell for run steps.
- Declare inputs and outputs at the top level of action.yml.
name: Setup
inputs:
version:
required: true
runs:
using: composite
steps:
- run: ./setup.sh ${{ inputs.version }}
shell: bashUse a reusable workflow if you need jobs
If you truly need multiple jobs, build a reusable workflow with on.workflow_call instead of a composite action.
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latestHow to prevent it
- Use composite actions for shared steps, reusable workflows for shared jobs.
- Keep action.yml to name, inputs, outputs, and runs.
- Do not put jobs: or on: in a composite action.