diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 95a8415..3f7457d 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -6,10 +6,14 @@ {{ range .CommitGroups -}} ### {{ .Title }} +{{ $subjects := list }} {{ range .Commits -}} +{{ if not (has .Subject $subjects) -}} - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ $subjects = append $subjects .Subject -}} {{ end }} -{{ end -}} +{{- end }} +{{- end -}} {{- if .NoteGroups -}} {{ range .NoteGroups -}} diff --git a/.drone.jsonnet b/.drone.jsonnet index 9f7eb55..3aa1276 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -161,14 +161,21 @@ local PipelineBuildPackage = { ], }, { - name: 'changelog', + name: 'changelog-generate', image: 'thegeeklab/git-chglog', commands: [ 'git fetch -tq', - 'git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}', 'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}', ], }, + { + name: 'changelog-format', + image: 'thegeeklab/alpine-tools', + commands: [ + 'prettier CHANGELOG.md', + 'prettier -w CHANGELOG.md', + ], + }, { name: 'publish-github', image: 'plugins/github-release', diff --git a/.drone.yml b/.drone.yml index 6dd6f75..12c883b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -179,13 +179,18 @@ steps: commands: - cd dist/ && sha256sum * > ../sha256sum.txt -- name: changelog +- name: changelog-generate image: thegeeklab/git-chglog commands: - git fetch -tq - - git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased} - git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased} +- name: changelog-format + image: thegeeklab/alpine-tools + commands: + - prettier CHANGELOG.md + - prettier -w CHANGELOG.md + - name: publish-github image: plugins/github-release settings: @@ -644,6 +649,6 @@ depends_on: --- kind: signature -hmac: 004d8bf66e7e19cba40f49afc42c3c1a70273af99238afc0476a7bc47ccb4441 +hmac: 67dca7df8ffc32a91c7059821b11bbfaad71b92dcb2979e9e30a8c6bf74d4fe3 ...