Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 47cf9df

Browse files
authored
chore(ci): update release-notes workflow configurations (#845)
* Improve the `release-drafter.yml` configuraiton file * Add `pull_request` event is for autolabeler * Add pull_request_target event for autolabeler to support PRs from forks
1 parent 0af8816 commit 47cf9df

File tree

2 files changed

+97
-15
lines changed

2 files changed

+97
-15
lines changed

.github/release-drafter.yml

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,107 @@
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: 'feature'
15+
branch:
16+
- '/feature\/.+/'
17+
title:
18+
- '/feat/i'
19+
- label: 'documentation'
20+
branch:
21+
- '/docs\/.+/'
22+
title:
23+
- '/docs/i'
24+
- label: 'maintenance'
25+
branch:
26+
- '/(chore|refactor|style|test|ci|perf|build)\/.+/'
27+
title:
28+
- '/(chore|refactor|style|test|ci|perf|build)/i'
29+
- label: 'chore'
30+
branch:
31+
- '/chore\/.+/'
32+
title:
33+
- '/chore/i'
34+
- label: 'refactor'
35+
branch:
36+
- '/refactor\/.+/'
37+
title:
38+
- '/refactor/i'
39+
- label: 'style'
40+
branch:
41+
- '/style\/.+/'
42+
title:
43+
- '/style/i'
44+
- label: 'test'
45+
branch:
46+
- '/test\/.+/'
47+
title:
48+
- '/test/i'
49+
- label: 'ci'
50+
branch:
51+
- '/ci\/.+/'
52+
title:
53+
- '/ci/i'
54+
- label: 'perf'
55+
branch:
56+
- '/perf\/.+/'
57+
title:
58+
- '/perf/i'
59+
- label: 'build'
60+
branch:
61+
- '/build\/.+/'
62+
title:
63+
- '/build/i'
64+
- label: 'deps'
65+
branch:
66+
- '/deps\/.+/'
67+
title:
68+
- '/deps/i'
69+
- label: 'revert'
70+
branch:
71+
- '/revert\/.+/'
72+
title:
73+
- '/revert/i'
374
categories:
4-
- title: Features
75+
- title: '🚀 Features'
576
labels:
77+
- 'feat'
678
- "type: enhancement"
779
- "type: new feature"
880
- "type: major"
9-
- title: 🐛 Bug Fixes/Improvements
81+
- title: '🐛 Bug Fixes'
1082
labels:
83+
- 'fix'
1184
- "type: improvement"
1285
- "type: bug"
1386
- "type: minor"
14-
- title: 🛠 Dependency upgrades
87+
- title: '📚 Documentation'
1588
labels:
16-
- "type: dependency upgrade"
17-
- "dependencies"
18-
- title: ⚙️ Build/CI
89+
- 'docs'
90+
- title: '🔧 Maintenance'
1991
labels:
92+
- 'maintenance'
93+
- 'chore'
94+
- 'refactor'
95+
- 'style'
96+
- 'test'
97+
- 'ci'
98+
- 'perf'
99+
- 'build'
20100
- "type: ci"
21101
- "type: build"
102+
- title: '⏪ Reverts'
103+
labels:
104+
- 'revert'
22105
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
23106
version-resolver:
24107
major:
@@ -31,13 +114,11 @@ version-resolver:
31114
labels:
32115
- 'type: patch'
33116
default: patch
34-
commitsh: $BASE_REF_NAME
35-
filter-by-commitsh: true
36117
template: |
37118
## What's Changed
38119
39120
$CHANGES
40121
41122
## Contributors
42123
43-
$CONTRIBUTORS
124+
$CONTRIBUTORS

.github/workflows/release-notes.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ on:
44
types: [closed,reopened]
55
push:
66
branches:
7-
- master
87
- '[7-9]+.[0-9]+.x'
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
pull_request_target:
11+
types: [opened, reopened, synchronize]
912
workflow_dispatch:
1013
jobs:
1114
release_notes:
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v3
1518
- name: Check if it has release drafter config file
1619
id: check_release_drafter
1720
run: |
@@ -21,12 +24,10 @@ jobs:
2124
id: extract_branch
2225
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
2326
# If it has release drafter:
24-
- uses: release-drafter/release-drafter@v6
27+
- uses: release-drafter/release-drafter@v5
2528
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
2629
env:
2730
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
28-
with:
29-
commitish: ${{ steps.extract_branch.outputs.value }}
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)