Skip to content

Commit b293928

Browse files
authored
ci: fix release-drafter duplicate entries and label/prefix mismatch (#79)
- 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)
1 parent b35f8bb commit b293928

2 files changed

Lines changed: 78 additions & 7 deletions

File tree

.github/labeler.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
1-
"type:docs":
1+
# Labels are applied based on PR title prefix (Conventional Commits) first,
2+
# then fall back to changed-file globs. The title-based rules take precedence
3+
# because they are listed first and actions/labeler applies the first match.
4+
5+
"type:feature":
6+
- head-branch:
7+
- "/^feat/"
8+
- title:
9+
- "/^feat(\\(.+\\))?:/i"
210
- changed-files:
311
- any-glob-to-any-file:
4-
- "**/*.md"
5-
- "LICENSE*"
6-
- "CHANGELOG*"
12+
- "src/**"
13+
14+
"type:bug":
15+
- head-branch:
16+
- "/^fix/"
17+
- title:
18+
- "/^fix(\\(.+\\))?:/i"
719

820
"type:chore":
21+
- head-branch:
22+
- "/^chore/"
23+
- "/^ci/"
24+
- "/^test/"
25+
- "/^refactor/"
26+
- "/^build/"
27+
- title:
28+
- "/^chore(\\(.+\\))?:/i"
29+
- "/^ci(\\(.+\\))?:/i"
30+
- "/^test(\\(.+\\))?:/i"
31+
- "/^refactor(\\(.+\\))?:/i"
32+
- "/^build(\\(.+\\))?:/i"
933
- changed-files:
1034
- any-glob-to-any-file:
11-
- ".github/**"
1235
- "build.zig"
1336
- "build.zig.zon"
1437
- ".gitignore"
1538
- ".editorconfig"
1639

17-
"type:feature":
40+
"type:docs":
41+
- head-branch:
42+
- "/^docs/"
43+
- title:
44+
- "/^docs(\\(.+\\))?:/i"
1845
- changed-files:
1946
- any-glob-to-any-file:
20-
- "src/**"
47+
- "**/*.md"
48+
- "docs/**"
49+
- "LICENSE*"
50+
- "CHANGELOG*"

.github/release-drafter.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,66 @@ template: |
66
$CHANGES
77
88
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
9+
10+
autolabeler:
11+
- label: "type:feature"
12+
title:
13+
- "/^feat(\\(.+\\))?:/i"
14+
- label: "type:bug"
15+
title:
16+
- "/^fix(\\(.+\\))?:/i"
17+
- label: "type:chore"
18+
title:
19+
- "/^chore(\\(.+\\))?:/i"
20+
- "/^ci(\\(.+\\))?:/i"
21+
- "/^test(\\(.+\\))?:/i"
22+
- "/^refactor(\\(.+\\))?:/i"
23+
- "/^build(\\(.+\\))?:/i"
24+
- label: "type:docs"
25+
title:
26+
- "/^docs(\\(.+\\))?:/i"
27+
928
categories:
1029
- title: "🚀 Features"
1130
labels:
1231
- "type:feature"
32+
exclude-labels:
33+
- "type:bug"
34+
- "type:chore"
35+
- "type:docs"
36+
- "type:spike"
1337
- title: "🐛 Bug Fixes"
1438
labels:
1539
- "type:bug"
40+
exclude-labels:
41+
- "type:feature"
42+
- "type:chore"
43+
- "type:docs"
44+
- "type:spike"
1645
- title: "🧰 Maintenance"
1746
labels:
1847
- "type:chore"
1948
- "tech-debt"
49+
exclude-labels:
50+
- "type:feature"
51+
- "type:bug"
52+
- "type:docs"
53+
- "type:spike"
2054
- title: "📝 Documentation"
2155
labels:
2256
- "type:docs"
57+
exclude-labels:
58+
- "type:feature"
59+
- "type:bug"
60+
- "type:chore"
61+
- "type:spike"
2362
- title: "🔬 Spikes & Research"
2463
labels:
2564
- "type:spike"
65+
2666
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
2767
change-title-escapes: '\<*_&'
68+
2869
version-resolver:
2970
major:
3071
labels:

0 commit comments

Comments
 (0)