Avoid copy-pasting workflow YAML across repos. Reusable workflows are called via workflow_call:
# .github/workflows/deploy.yml (in a shared repo)
on:
workflow_call:
inputs:
environment:
type: string
required: true
# Calling workflow
jobs:
deploy:
uses: my-org/shared-workflows/.github/workflows/deploy.yml@main
with:
environment: production
Composite actions also help — combine multiple steps into a single action you can reuse across workflows.