Central home for my reusable GitHub Actions workflows and composite actions.
The main assumption of this repo is that consumer repositories adopt it through the Copier template first. After that, the primary entrypoints in the consumer repo are the generated workflows:
ci_update.ymlpr_automerge.ymlpr_labeler.ymlsetup_labels.ymlpr_bump.yml when bump_script_path is setrelease_draft.yml when do_releases is enabledsite.yml when a site workflow is enabledThose workflows keep the consumer repo aligned with this central CI repo, handle common PR automation, create release drafts, sync repository labels, and set up site builds.
tools/init_ci_repo.sh
The helper applies the Copier template, then asks whether to set
CI_BOT_TOKEN with gh secret set. It can infer the repository from a GitHub
git remote or gh repo view; otherwise pass --repo owner/repo. Pass extra
Copier options after --.
Install Copier:
pipx install copier
Apply the template:
copier copy --trust gh:athackst/ci .
Add a repository secret named CI_BOT_TOKEN:
Settings -> Secrets and variables -> Actions.CI_BOT_TOKEN with that token value.Required repository permissions for the token:
Contents: Read and write for update and bump commits.Pull requests: Read and write for PR labels, comments, updater PRs, bump PRs, and automerge.Issues: Read and write for repository labels, PR comments, and failure issues.Actions: Read and write for updater PRs that modify workflow files.Workflows: Read and write for commits that create or update workflow files.Variables: Read and write for generated release_draft.yml workflows that persist DRAFT_RELEASE_ID.This repo is opinionated around one shared CI config file, .github/ci-config.yml,
which drives:
The workflows are meant to compose around that config instead of each repository re-declaring the same rules in multiple places.
Copier asks a small number of questions and uses the answers to generate the entrypoint workflows plus a shared CI config.
bump_script_path
pr_bump.yml.VERSION, MAJOR_VERSION, MINOR_VERSION, and PATCH_VERSION.site_generator
site.yml, and if so whether it uses MkDocs or Jekyll.none is the default and skips site workflow generation entirely.mkdocs uses mkdocs_site.yml.jekyll uses jekyll_site.yml.main pushes and release publishes; Jekyll site workflows run on main pushes.automerge_mode
pr_automerge.yml handles labeled pull requests.poll is the default and waits for checks before merging directly, which works on private repos without GitHub native auto-merge support.native enables GitHub auto-merge for labeled PRs and lets GitHub merge when requirements are met.disabled keeps the workflow in place but disables automerge actions.do_releases
release_draft.yml.release_draft.yml creates or updates a draft release on main pushes.main publishes dev, and release events publish the release tag plus latest.release_template
.github/release_template.md.release_draft.yml when rendering the draft release body.$CHANGES for generated changelog content and $VERSION / $RESOLVED_VERSION for the resolved version.do_releases is enabled..github/ci-config.yml is the center of the convention. It combines concepts
that would normally live in separate files:
This is intentionally a modified combination of the upstream release-drafter/release-drafter and actions/labeler config formats.
Modifications to release-drafter.yml
template-file so the release body can live in .github/release_template.md instead of being embedded in YAML.Modifications to labeler.yml
color and description metadata to labels so the same config can also drive repository label setup.Colors are set according to the following label palette:
| Label | Color | Preview |
|---|---|---|
breaking |
#7f1d1d |
|
bug |
#d73a4a |
|
enhancement |
#0f766e |
|
maintenance |
#0ea5e9 |
|
dependencies |
#1d4ed8 |
|
documentation |
#64748b |
|
automerge |
#eab308 |
|
good first issue |
#c4b5fd |
|
help wanted |
#db2777 |
|
question |
#7e22ce |
|
duplicate |
#cbd5e1 |
|
invalid |
#a3a3a3 |
|
wontfix |
#78716c |