Skip to content

Commit 319dd20

Browse files
committedOct 10, 2023
docs: Tidy up release notes
1 parent 82b5fa9 commit 319dd20

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Release history
2-
{{- range $release := gitHubListReleases "twpayne/chezmoi" }}
2+
3+
{{- $releases := gitHubListReleases "twpayne/chezmoi" }}
4+
{{- $lastReleaseIndex := sub (len $releases) 1 }}
5+
{{- range $index, $release := $releases }}
36

47
## [{{ $release.Name | trimPrefix "v" }}]({{ $release.HTMLURL }}) ({{ $release.PublishedAt | gitHubTimestampFormat "2006-01-02" }})
58

69
{{ $release.Body
7-
| replaceAllRegex "(?m)^## What's Changed$" ""
8-
| replaceAllRegex "(?m)^## Changelog\\r?$" ""
9-
| replaceAllRegex "(?m)^## (New Contributors)\\r?$" "$1\n"
10-
| replaceAllRegex "\\*\\*(Full Changelog)\\*\\*" "$1"
10+
| replaceAllRegex "(?m)^#+ (Changelog\\r?|What's Changed)$" ""
11+
| replaceAllRegex "(?m)^#+ (.*)\\r?$" "\n\n$1\n"
12+
| replaceAllRegex "\\*\\*(Full Changelog)\\*\\*.*\n" ""
1113
| replaceAllRegex "(https://github\\.com/twpayne/chezmoi/compare/(\\S+))" "[`$2`]($1)"
1214
| replaceAllRegex "@(\\S+)" "[**$0**](https://github.com/$1)"
1315
| replaceAllRegex "pull request #(\\d+)" "pull request https://github.com/twpayne/chezmoi/pull/$1"
@@ -16,5 +18,14 @@
1618
| replaceAllRegex "(?m)^([0-9a-f]{7,})" "* $1"
1719
| replaceAllRegex "(?m)^\\* ([0-9a-f]{7,})" "* [`$1`](https://github.com/twpayne/chezmoi/commit/$1)"
1820
| replaceAllRegex "\\r\\n" "\\n"
21+
| trim
22+
| default "Internal changes only"
1923
}}
24+
25+
{{- if ne $index $lastReleaseIndex }}
26+
{{- $prevRelease := index $releases (add $index 1) }}
27+
28+
Full changelog: [{{ $prevRelease.Name }}...{{ $release.Name }}](https://github.com/twpayne/chezmoi/compare/{{ $prevRelease.Name }}...{{ $release.Name }})
29+
{{- end }}
30+
2031
{{- end }}

0 commit comments

Comments
 (0)
Please sign in to comment.