What you’ll build
- A local composite action defined in
composite-action/action.yaml - A workflow that calls the composite action using a local path (
./composite-action) - Example run output and troubleshooting tips
Prerequisites
- A GitHub repository with a
.github/workflows/folder - Basic familiarity with GitHub Actions workflows and YAML
Create the composite action
- In the root of your repository create a folder named
composite-action. - Inside that folder create an
action.yamlfile with this content:
inputs.environmentis declared as required — callers must provide this input.runs.using: "composite"marks the action as a composite action composed of multiple steps.- The
stepsarray defines the shell commands that execute when the action is invoked.
Composite action fields at a glance
Use the composite action in a workflow
Create a workflow file (for example.github/workflows/ci-2.yml) that calls the local composite action:
- Use a local path (
./composite-action) for actions defined in the same repository. - Pass required inputs with the
withblock.
Including
[skip ci] in your commit message prevents workflows from being triggered by that commit. This is useful when you want to test a specific workflow from the Actions UI using “Run workflow” without running all workflows on push.Running the workflow and troubleshooting
When you run the workflow (push or use “Run workflow”), the runner will:- Check out the repository.
- Look for the composite action at the specified relative path.
- Execute the steps defined in
action.yaml.
- Typo in the
usespath (e.g.,./composite-actionsvs./composite-action) — correct the path and commit again. action.yamlmissing or incorrectly named — ensure the file exists and is namedaction.ymloraction.yaml.- Incorrect repository structure — verify that
composite-action/action.yamlis at the repository root.

If the workflow reports “Unable to find action …”, double-check the
uses path and the file name. Composite actions must be defined with an action.yml or action.yaml (or a Dockerfile for container actions) at the path you reference.Example run output
Successful run output for the composite action looks like:Summary
- Define a composite action with
runs.using: "composite"and list itsstepsinaction.yaml. - Call local composite actions using a relative path like
./composite-actionand supply required inputs withwith. - If GitHub cannot find your action, verify the
usespath, file name (action.ymloraction.yaml), and repository structure.