From 3fe87de594ea3188bf19cb3503c1c3848f531e16 Mon Sep 17 00:00:00 2001 From: Matthias Leutenegger Date: Thu, 12 Nov 2020 16:25:48 +0100 Subject: [PATCH] add: git-chglog --- .chglog/CHANGELOG.tpl.md | 59 ++++++++++++++++++++++++++++++++++++++++ .chglog/config.yml | 31 +++++++++++++++++++++ package.json | 5 ++++ 3 files changed, 95 insertions(+) create mode 100644 .chglog/CHANGELOG.tpl.md create mode 100644 .chglog/config.yml create mode 100644 package.json diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100644 index 0000000..fe46f5f --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,59 @@ +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts +{{ range .RevertCommits -}} +- {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +## History +For versions before 0.2.9, see [HISTORY.md](HISTORY.md) + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100644 index 0000000..6b97559 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,31 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/syntro-opensource/ansible.silverstripe +options: + commits: + filters: + Type: + - add + - fix + - change + - remove + - deprecate + - Bump + commit_groups: + title_maps: + add: 🍰 Added + fix: 🐞 Fixed + change: 🔧 Changed + deprecate: 💀 Deprecated + remove: 🗑 Removed + Bump: 🧬 Dependencies + header: + pattern: "^(\\w*)\\:?\\s(.*)$" + pattern_maps: + - Type + - Subject + notes: + keywords: + - BREAKING CHANGE diff --git a/package.json b/package.json new file mode 100644 index 0000000..d6613d3 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "changelog": "git-chglog 0.2.8.." + } +}