From f278ec1ad8224896df2c2f2f066ec246f3b5ae1a Mon Sep 17 00:00:00 2001 From: "Victor M. Varela" Date: Fri, 20 Mar 2026 02:11:59 +0100 Subject: [PATCH] ci: fix release-drafter duplicate entries and label/prefix mismatch - Add autolabeler rules to release-drafter.yml mapping Conventional Commit prefixes (feat:/fix:/chore:/docs:/test:/ci:/refactor:) to type:* labels, so PRs are categorized from their title rather than requiring manual labels - Add exclude-labels to each release-drafter category so a PR with multiple type:* labels only appears in the first matching section (no duplicates) - Update labeler.yml with title and head-branch pattern rules matching the same Conventional Commit prefixes, keeping file-glob rules as fallback - Remove .github/** glob from type:chore to prevent CI/packaging PRs from being mislabeled when their title indicates a feature (e.g. feat: add APK) Closes #78 (action items) --- .github/labeler.yml | 44 +++++++++++++++++++++++++++++++------ .github/release-drafter.yml | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 7 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 81c591b..db87212 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,20 +1,50 @@ -"type:docs": +# Labels are applied based on PR title prefix (Conventional Commits) first, +# then fall back to changed-file globs. The title-based rules take precedence +# because they are listed first and actions/labeler applies the first match. + +"type:feature": + - head-branch: + - "/^feat/" + - title: + - "/^feat(\\(.+\\))?:/i" - changed-files: - any-glob-to-any-file: - - "**/*.md" - - "LICENSE*" - - "CHANGELOG*" + - "src/**" + +"type:bug": + - head-branch: + - "/^fix/" + - title: + - "/^fix(\\(.+\\))?:/i" "type:chore": + - head-branch: + - "/^chore/" + - "/^ci/" + - "/^test/" + - "/^refactor/" + - "/^build/" + - title: + - "/^chore(\\(.+\\))?:/i" + - "/^ci(\\(.+\\))?:/i" + - "/^test(\\(.+\\))?:/i" + - "/^refactor(\\(.+\\))?:/i" + - "/^build(\\(.+\\))?:/i" - changed-files: - any-glob-to-any-file: - - ".github/**" - "build.zig" - "build.zig.zon" - ".gitignore" - ".editorconfig" -"type:feature": +"type:docs": + - head-branch: + - "/^docs/" + - title: + - "/^docs(\\(.+\\))?:/i" - changed-files: - any-glob-to-any-file: - - "src/**" + - "**/*.md" + - "docs/**" + - "LICENSE*" + - "CHANGELOG*" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 33e75c3..237d955 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -6,25 +6,66 @@ template: | $CHANGES **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION + +autolabeler: + - label: "type:feature" + title: + - "/^feat(\\(.+\\))?:/i" + - label: "type:bug" + title: + - "/^fix(\\(.+\\))?:/i" + - label: "type:chore" + title: + - "/^chore(\\(.+\\))?:/i" + - "/^ci(\\(.+\\))?:/i" + - "/^test(\\(.+\\))?:/i" + - "/^refactor(\\(.+\\))?:/i" + - "/^build(\\(.+\\))?:/i" + - label: "type:docs" + title: + - "/^docs(\\(.+\\))?:/i" + categories: - title: "🚀 Features" labels: - "type:feature" + exclude-labels: + - "type:bug" + - "type:chore" + - "type:docs" + - "type:spike" - title: "🐛 Bug Fixes" labels: - "type:bug" + exclude-labels: + - "type:feature" + - "type:chore" + - "type:docs" + - "type:spike" - title: "🧰 Maintenance" labels: - "type:chore" - "tech-debt" + exclude-labels: + - "type:feature" + - "type:bug" + - "type:docs" + - "type:spike" - title: "📝 Documentation" labels: - "type:docs" + exclude-labels: + - "type:feature" + - "type:bug" + - "type:chore" + - "type:spike" - title: "🔬 Spikes & Research" labels: - "type:spike" + change-template: "- $TITLE (#$NUMBER) @$AUTHOR" change-title-escapes: '\<*_&' + version-resolver: major: labels: