How to Share Starter Workflows With an Org .github Repo
A repo literally named .github in your org holds starter workflows and org defaults that every other repo can pull from.
Create a repo named .github in the org. Put starter workflows under workflow-templates/ with a .properties.json describing each. They then appear as suggestions when any org repo adds a workflow.
Steps
- Create a repo named
.githubin the organization. - Add
workflow-templates/ci.ymlandworkflow-templates/ci.properties.json. - Use
$default-branchand$protected-branchesplaceholders the template engine substitutes.
Starter workflow template
workflow-templates/ci.yml
on:
push:
branches: [ $default-branch ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm testTemplate metadata
workflow-templates/ci.properties.json
{
"name": "Org Node CI",
"description": "Standard Node build and test for org repos.",
"iconName": "example",
"categories": ["Node"]
}Gotchas
- Starter workflows are copied into a repo once; later template edits do not update repos that already adopted them.
- For live-updating shared logic, prefer a reusable
workflow_callworkflow over a starter template.
Related guides
How to Share a Reusable Workflow From a Central RepoKeep one canonical CI workflow in a central repository and call it from every other repo with uses and workfl…
How to Enforce an Organization Required Workflow Across ReposUse organization-level required workflows (repository rulesets) to force a chosen reusable workflow to run on…