Introduction
As an engineering organization expands, it frequently manages dozens or hundreds of independent repositories. Many of these projects require identical execution steps in their pipelines, such as setting up dependencies or linting code. Grouping these recurring tasks into Composite Actions allows teams to maintain uniformity without copying YAML definitions.
Defining a Composite Action
Create an action.yml configuration inside a central repository to define your shared steps:
name: 'Setup Node with Cache'
description: 'Checks out code, sets up Node.js, and configures npm caching'
inputs:
node-version:
description: 'Version of Node to use'
required: true
default: '18'
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- run: npm ci
shell: bash
← PreviousBuilding Resilient Pipelines with GCP Cloud Pub/Sub and Dataflow
Next →Mastering AWS IAM Policies: Principle of Least Privilege in Practice
Get in touch