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 3abc224..ea74111 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -142,14 +142,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 9021424..1d39e5e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -160,13 +160,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: @@ -625,6 +630,6 @@ depends_on: --- kind: signature -hmac: 2f08b1081bd9e344185a5c1c401559e176c284548826d851d49fb3c19ff438b0 +hmac: 998933261dc3a2f06a23d8a7ef922574ce8574c2d77e003ef018d7deb7768952 ... diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..97e0b3e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.drone.yml +*.tpl.md