Skip to content

Commit 5eb7f9f

Browse files
authored
chore(ci): Enhance release notes workflow settings (#183)
This pull request updates the release-drafter template to enhance the quality of release notes. Additionally, we've introduced two new triggers, `pull_request` and `pull_request_target`, which automatically apply labels to pull requests based on their titles. This is essential for autolabeling and to accommodate pull requests from forks.
1 parent 657a211 commit 5eb7f9f

File tree

2 files changed

+110
-16
lines changed

2 files changed

+110
-16
lines changed

.github/release-drafter.yml

Lines changed: 101 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,117 @@
11
name-template: $RESOLVED_VERSION
22
tag-template: v$RESOLVED_VERSION
3+
pull-request:
4+
title-templates:
5+
fix: '🐛 $TITLE (#$NUMBER)'
6+
feat: '🚀 $TITLE (#$NUMBER)'
7+
default: '$TITLE (#$NUMBER)'
8+
autolabeler:
9+
- label: 'bug'
10+
branch:
11+
- '/fix\/.+/'
12+
title:
13+
- '/fix/i'
14+
- label: 'improvement'
15+
branch:
16+
- '/improv\/.+/'
17+
title:
18+
- '/improv/i'
19+
- label: 'feature'
20+
branch:
21+
- '/feature\/.+/'
22+
title:
23+
- '/feat/i'
24+
- label: 'documentation'
25+
branch:
26+
- '/docs\/.+/'
27+
title:
28+
- '/docs/i'
29+
- label: 'maintenance'
30+
branch:
31+
- '/(chore|refactor|style|test|ci|perf|build)\/.+/'
32+
title:
33+
- '/(chore|refactor|style|test|ci|perf|build)/i'
34+
- label: 'chore'
35+
branch:
36+
- '/chore\/.+/'
37+
title:
38+
- '/chore/i'
39+
- label: 'refactor'
40+
branch:
41+
- '/refactor\/.+/'
42+
title:
43+
- '/refactor/i'
44+
- label: 'style'
45+
branch:
46+
- '/style\/.+/'
47+
title:
48+
- '/style/i'
49+
- label: 'test'
50+
branch:
51+
- '/test\/.+/'
52+
title:
53+
- '/test/i'
54+
- label: 'ci'
55+
branch:
56+
- '/ci\/.+/'
57+
title:
58+
- '/ci/i'
59+
- label: 'perf'
60+
branch:
61+
- '/perf\/.+/'
62+
title:
63+
- '/perf/i'
64+
- label: 'build'
65+
branch:
66+
- '/build\/.+/'
67+
title:
68+
- '/build/i'
69+
- label: 'deps'
70+
branch:
71+
- '/deps\/.+/'
72+
title:
73+
- '/deps/i'
74+
- label: 'revert'
75+
branch:
76+
- '/revert\/.+/'
77+
title:
78+
- '/revert/i'
379
categories:
4-
- title: 🚀 Features
80+
- title: '🚀 Features'
581
labels:
82+
- 'feature'
683
- "type: enhancement"
784
- "type: new feature"
885
- "type: major"
9-
- title: 🚀 Bug Fixes/Improvements
86+
- "type: minor"
87+
- title: '💡 Improvements'
1088
labels:
89+
- 'improvement'
1190
- "type: improvement"
91+
92+
- title: '🐛 Bug Fixes'
93+
labels:
94+
- 'fix'
95+
- 'bug'
1296
- "type: bug"
13-
- "type: minor"
14-
- title: 🛠 Dependency upgrades
97+
- title: '📚 Documentation'
1598
labels:
16-
- "type: dependency upgrade"
17-
- "dependencies"
18-
- title: ⚙️ Build/CI
99+
- 'docs'
100+
- title: '🔧 Maintenance'
19101
labels:
102+
- 'maintenance'
103+
- 'chore'
104+
- 'refactor'
105+
- 'style'
106+
- 'test'
107+
- 'ci'
108+
- 'perf'
109+
- 'build'
20110
- "type: ci"
21111
- "type: build"
112+
- title: '⏪ Reverts'
113+
labels:
114+
- 'revert'
22115
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
23116
version-resolver:
24117
major:
@@ -38,4 +131,4 @@ template: |
38131
39132
## Contributors
40133
41-
$CONTRIBUTORS
134+
$CONTRIBUTORS

.github/workflows/release-notes.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ on:
55
push:
66
branches:
77
- '[4-9]+.[0-9]+.x'
8+
pull_request:
9+
types: [opened, reopened, synchronize, labeled]
10+
pull_request_target:
11+
types: [opened, reopened, synchronize, labeled]
812
workflow_dispatch:
913
jobs:
1014
release_notes:
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1418
- name: Check if it has release drafter config file
1519
id: check_release_drafter
1620
run: |
1721
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
18-
echo ::set-output name=has_release_drafter::${has_release_drafter}
22+
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
1923
- name: Extract branch name
2024
id: extract_branch
21-
run: echo ::set-output name=value::${GITHUB_REF:11}
25+
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
2226
# If it has release drafter:
23-
- uses: release-drafter/release-drafter@v5.21.1
27+
- uses: release-drafter/release-drafter@v6
2428
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
2529
env:
2630
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
27-
with:
28-
commitish: ${{ steps.extract_branch.outputs.value }}
29-
filter-by-commitish: true
3031
# Otherwise:
3132
- name: Export Gradle Properties
3233
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
@@ -45,4 +46,4 @@ jobs:
4546
name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }}
4647
tag: v${{ steps.release_notes.outputs.next_version }}
4748
bodyFile: CHANGELOG.md
48-
token: ${{ secrets.GH_TOKEN }}
49+
token: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)