Reusable Workflows
ELI5 — The Vibe Check
Reusable Workflows are the DRY principle for GitHub Actions. Instead of copying the same CI config into 50 repos, you write it once and call it from everywhere. It's like making a function but for your entire CI pipeline. Change once, update everywhere.
Real Talk
Reusable workflows in GitHub Actions allow defining workflow logic in one repository and calling it from other workflows using the workflow_call trigger. They accept inputs and secrets, return outputs, and support nesting. This enables organizational CI/CD standardization.
Show Me The Code
# Caller workflow
jobs:
ci:
uses: org/shared-workflows/.github/workflows/ci.yml@main
with:
node-version: 20
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
When You'll Hear This
"All 30 repos call the same reusable workflow for CI." / "We updated the shared workflow once and every repo got the new linting rules."
Related Terms
GitHub Actions
GitHub Actions is CI/CD built right into GitHub. Push code, run tests, deploy — all from YAML files in your repo. No separate CI server needed.
Workflow Dispatch
Workflow Dispatch is the 'run this manually' button for GitHub Actions. Instead of waiting for a push or PR, you click a button and pass it inputs.