Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 7148b3d

Browse files
authored
chore: improve generated changelog (#25)
1 parent 2633908 commit 7148b3d

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.chglog/CHANGELOG.tpl.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
{{ range .CommitGroups -}}
77
### {{ .Title }}
88

9+
{{ $subjects := list }}
910
{{ range .Commits -}}
11+
{{ if not (has .Subject $subjects) -}}
1012
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
13+
{{ $subjects = append $subjects .Subject -}}
1114
{{ end }}
12-
{{ end -}}
15+
{{- end }}
16+
{{- end -}}
1317

1418
{{- if .NoteGroups -}}
1519
{{ range .NoteGroups -}}

.drone.jsonnet

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,21 @@ local PipelineBuildBinaries = {
116116
],
117117
},
118118
{
119-
name: 'changelog',
119+
name: 'changelog-generate',
120120
image: 'thegeeklab/git-chglog',
121121
commands: [
122122
'git fetch -tq',
123-
'git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}',
124123
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
125124
],
126125
},
126+
{
127+
name: 'changelog-format',
128+
image: 'thegeeklab/alpine-tools',
129+
commands: [
130+
'prettier CHANGELOG.md',
131+
'prettier -w CHANGELOG.md',
132+
],
133+
},
127134
{
128135
name: 'publish',
129136
image: 'plugins/github-release',

.drone.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ steps:
8787
commands:
8888
- cd release/ && sha256sum * > sha256sum.txt
8989

90-
- name: changelog
90+
- name: changelog-generate
9191
image: thegeeklab/git-chglog
9292
commands:
9393
- git fetch -tq
94-
- git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}
9594
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
9695

96+
- name: changelog-format
97+
image: thegeeklab/alpine-tools
98+
commands:
99+
- prettier CHANGELOG.md
100+
- prettier -w CHANGELOG.md
101+
97102
- name: publish
98103
image: plugins/github-release
99104
settings:
@@ -389,6 +394,6 @@ depends_on:
389394

390395
---
391396
kind: signature
392-
hmac: c19c718aab5069878ee662ea706da148d8e2f6a8d1ee5121e530d0988eafbf16
397+
hmac: 450e524b8b60cf174405bbe7c26be014671ae1a928157be53706232ace778e14
393398

394399
...

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.drone.yml
2+
*.tpl.md

0 commit comments

Comments
 (0)