Composite Actions
What you'll learn: How to bundle multiple workflow steps into a single reusable action that can be shared across workflows and repositories.
What Are Composite Actions?
Composite actions are custom GitHub Actions that combine multiple workflow steps into a single, reusable unit. Think of them as recipes — instead of writing out the same 5-step cooking process in every meal plan, you create one "make sauce" recipe that you reference whenever needed.
Unlike workflows (which run entire jobs), composite actions package steps together. They live in their own repository or in a .github/actions/ directory and can accept inputs and produce outputs, making them flexible and parameterizable.
Why Use Composite Actions?
When you find yourself copying the same sequence of steps across multiple workflows — like setup steps, build commands, or deployment tasks — composite actions eliminate duplication. They improve maintainability: update the action once, and all workflows using it benefit automatically.
Structure
A composite action is defined in an action.yml file with three key sections:
- inputs: Parameters the action accepts (like function arguments)
- runs: The
using: "composite"declaration plus the steps to execute - outputs: Values the action returns for use in later workflow steps
Each step in a composite action can use run commands or call other actions. You reference inputs using the ${{ inputs.input-name }} syntax.
Key Takeaway
Composite actions transform repetitive workflow step sequences into reusable, maintainable building blocks with inputs and outputs — reducing duplication and centralizing common pipeline logic across your CI/CD workflows.