From 78828950627137d28dd7f4a11be3a1d15e590612 Mon Sep 17 00:00:00 2001 From: "const.koutsakis@aurecongroup.com" Date: Mon, 27 Apr 2026 03:15:13 +1000 Subject: [PATCH] chore: PR title lint + release-drafter (#12) Adds the second half of #12 (release-drafter); pr-title.yml itself shipped in #10's bundle. Port .github/workflows/release-drafter.yml + the categories / autolabeler / version-resolver config in .github/release-drafter.yml verbatim from Teller. Pin release-drafter@v6 to commit SHA 6a93d829.... release-drafter is exempt from required-status-checks (workflow runs on push to main + PR label events; never on every PR). Already in EXEMPT_WORKFLOWS in check_required_contexts.py. Closes #12 Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/release-drafter.yml | 82 +++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 31 ++++++++++ 2 files changed, 113 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..14f8f41 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,82 @@ +# Release-drafter configuration. +# +# Drafts release notes by reading the conventional-commit prefix of each +# merged PR title (squash-merge subject) and grouping into the categories +# below. Categories map 1:1 to the [tool.commitizen].customize.schema_pattern +# types enforced by `Lint PR title` CI; see check_commit_types.py. + +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" + +categories: + - title: "Features" + labels: + - "feat" + - title: "Fixes" + labels: + - "fix" + - title: "Housekeeping" + labels: + - "chore" + - "docs" + - "refactor" + - "test" + - "release" + +# Match conventional-commit prefixes against PR titles regardless of label — +# release-drafter assigns the synthetic label so the categories above resolve +# even when the PR doesn't carry a manual label. +autolabeler: + - label: "feat" + title: + - "/^feat(\\(.+\\))?:/i" + - label: "fix" + title: + - "/^fix(\\(.+\\))?:/i" + - label: "chore" + title: + - "/^chore(\\(.+\\))?:/i" + - label: "docs" + title: + - "/^docs(\\(.+\\))?:/i" + - label: "refactor" + title: + - "/^refactor(\\(.+\\))?:/i" + - label: "test" + title: + - "/^test(\\(.+\\))?:/i" + - label: "release" + title: + - "/^release(\\(.+\\))?:/i" + +# SemVer resolver: +# - any `feat` PR since the last release → minor bump +# - any `fix` PR with no `feat` → patch bump +# - everything else (chore/docs/refactor/test/release-only) → patch bump +# `major` is not auto-resolved — major bumps are deliberate human calls. +version-resolver: + minor: + labels: + - "feat" + patch: + labels: + - "fix" + - "chore" + - "docs" + - "refactor" + - "test" + - "release" + default: patch + +template: | + ## What's changed in v$RESOLVED_VERSION + + $CHANGES + + **Full changelog:** https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION + +change-template: "- $TITLE ([#$NUMBER]($URL))" +change-title-escapes: '\<*_&' # escape markdown control chars in PR titles + +exclude-labels: + - "skip-changelog" diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..4f7ccbe --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,31 @@ +name: Release Drafter + +# Updates a draft GitHub Release on every push to `main` and on PR +# label / open / reopen events. The drafted release body becomes the +# `release.yml` workflow's input on tag push (see release.yml). +# +# Single-source-of-truth: the categories + version-resolver in +# .github/release-drafter.yml mirror the conventional-commit prefixes +# enforced by check_commit_types.py and the `Lint PR title` job. + +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize, labeled, unlabeled] + branches: [main] + +permissions: + contents: write # create/update draft releases + pull-requests: read + +jobs: + draft: + runs-on: ubuntu-latest + name: Draft next release + steps: + - uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 # v6 + with: + config-name: release-drafter.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}