GB Gabriel Butoeru
← All articles
GitHub 23/06/2026 · 1 min read · butoerugabriel

Creating Reusable GitHub Actions with Composite Actions and Workflows

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