-
Notifications
You must be signed in to change notification settings - Fork 509
91 lines (84 loc) · 3.06 KB
/
generate-changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Generate changelog
on: [ workflow_dispatch ]
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'pinterest/ktlint'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0 # fetch all commits/branches/tags
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: Get last released version
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
fromTag: "${{ env.version }}"
# This Github action is run before building a new release. All PR's created after last release and between current HEAD are to be
# included
toTag: "HEAD"
configurationJson: |
{
"template": "## [Unreleased]\n\n#{{CHANGELOG}}",
"categories": [
{
"title": "### 💔 Breaking changes",
"labels": ["api changelog"],
"exclude_labels": ["exclude from changelog"]
},
{
"title": "### 🆕 Features",
"labels": ["feature changelog"],
"exclude_labels": ["exclude from changelog"],
"empty_content": "None"
},
{
"title": "### 🔧 Fixes",
"labels": ["fix changelog"],
"exclude_labels": ["exclude from changelog"],
"empty_content": "None"
},
{
"title": "### 📦 Dependencies",
"exhaustive_rules": false,
"rules": [
{
"pattern": "dependency changelog",
"on_property": "labels"
},
{
"pattern": "renovate\\[bot\\]",
"on_property": "author"
}
],
"exclude_labels": ["exclude from changelog"]
},
{
"title": "### 💬 Other",
"labels": [],
"exclude_labels": ["documentation", "exclude from changelog"]
}
],
"pr_template": "\n* #{{TITLE}} - [##{{NUMBER}}](#{{URL}}), by @#{{AUTHOR}}",
"empty_template": "- no changes",
"sort": {
"order": "ASC",
"on_property": "mergedAt"
},
"max_pull_requests": 1000,
"max_back_track_time_days": 1000
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo generated changelog
env:
CHANGELOG: ${{ steps.build_changelog.outputs.changelog }}
run: echo -e "$CHANGELOG"