Skip to content

Commit

Permalink
better changelog template
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien-marty authored Nov 12, 2024
1 parent 036baac commit bba19da
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 65 deletions.
112 changes: 64 additions & 48 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,131 @@
# CHANGELOG
## v0.6.0 (2024-11-11)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.6...v0.6.0)
## [v0.6.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.6.0) (2024-11-11)

#### Added

**Added**
- Add next-version-only flag [\#31](https://github.com/fabien-marty/github-next-semantic-version/pull/31) ([fabien-marty](https://github.com/fabien-marty))
- Add generate-changelog new feature [\#32](https://github.com/fabien-marty/github-next-semantic-version/pull/32) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.6 (2024-11-02)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.6...v0.6.0)</sub>

## [v0.5.6](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.6) (2024-11-02)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.5...v0.5.6)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.5...v0.5.6)</sub>

## v0.5.5 (2024-11-02)
## [v0.5.5](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.5) (2024-11-02)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.4...v0.5.5)
#### Changed

**Changed**
- doc update [\#27](https://github.com/fabien-marty/github-next-semantic-version/pull/27) ([fabien-marty](https://github.com/fabien-marty))
- change exit code for create-release binary in some case [\#28](https://github.com/fabien-marty/github-next-semantic-version/pull/28) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.4 (2024-11-01)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.4...v0.5.5)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.3...v0.5.4)
## [v0.5.4](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.4) (2024-11-01)

#### Changed

**Changed**
- update doc [\#26](https://github.com/fabien-marty/github-next-semantic-version/pull/26) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.3 (2024-11-01)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.3...v0.5.4)</sub>

## [v0.5.3](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.3) (2024-11-01)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.2...v0.5.3)
#### Changed

**Changed**
- publish github-create-release binary [\#23](https://github.com/fabien-marty/github-next-semantic-version/pull/23) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.2 (2024-11-01)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.2...v0.5.3)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.1...v0.5.2)
## [v0.5.2](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.2) (2024-11-01)

#### Fixed

**Fixed**
- Fix release foce option [\#22](https://github.com/fabien-marty/github-next-semantic-version/pull/22) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.1 (2024-10-31)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.1...v0.5.2)</sub>

## [v0.5.1](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.1) (2024-10-31)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.0...v0.5.1)
#### Changed

**Changed**
- improve README [\#20](https://github.com/fabien-marty/github-next-semantic-version/pull/20) ([fabien-marty](https://github.com/fabien-marty))

## v0.5.0 (2024-10-31)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.5.0...v0.5.1)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.4.0...v0.5.0)
## [v0.5.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.5.0) (2024-10-31)

#### Added

**Added**
- add a &#34;create release&#34; binary [\#14](https://github.com/fabien-marty/github-next-semantic-version/pull/14) ([fabien-marty](https://github.com/fabien-marty))

## v0.4.0 (2024-10-27)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.4.0...v0.5.0)</sub>

## [v0.4.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.4.0) (2024-10-27)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.3.1...v0.4.0)
#### Added

**Added**
- add prefixed tags support [\#11](https://github.com/fabien-marty/github-next-semantic-version/pull/11) ([fabien-marty](https://github.com/fabien-marty))

## v0.3.1 (2024-10-22)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.3.1...v0.4.0)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.3.0...v0.3.1)
## [v0.3.1](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.3.1) (2024-10-22)

#### Changed

**Changed**
- add env var for tag regex [\#10](https://github.com/fabien-marty/github-next-semantic-version/pull/10) ([fabien-marty](https://github.com/fabien-marty))

## v0.3.0 (2024-10-22)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.3.0...v0.3.1)</sub>

## [v0.3.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.3.0) (2024-10-22)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.2...v0.3.0)
#### Added

**Added**
- add tag filter (with a configurable regex) [\#9](https://github.com/fabien-marty/github-next-semantic-version/pull/9) ([fabien-marty](https://github.com/fabien-marty))

## v0.2.2 (2024-08-26)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.2...v0.3.0)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.1...v0.2.2)
## [v0.2.2](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.2.2) (2024-08-26)

#### Fixed

**Fixed**
- fix an important bug about PR order [\#7](https://github.com/fabien-marty/github-next-semantic-version/pull/7) ([fabien-marty](https://github.com/fabien-marty))

**Changed**
#### Changed

- add badge [\#6](https://github.com/fabien-marty/github-next-semantic-version/pull/6) ([fabien-marty](https://github.com/fabien-marty))

## v0.2.1 (2024-08-25)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.1...v0.2.2)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.0...v0.2.1)
## [v0.2.1](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.2.1) (2024-08-25)

#### Changed

**Changed**
- improve DX [\#3](https://github.com/fabien-marty/github-next-semantic-version/pull/3) ([fabien-marty](https://github.com/fabien-marty))
- add alpine support [\#4](https://github.com/fabien-marty/github-next-semantic-version/pull/4) ([fabien-marty](https://github.com/fabien-marty))

## v0.2.0 (2024-08-24)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.2.0...v0.2.1)</sub>

## [v0.2.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.2.0) (2024-08-24)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.1.0...v0.2.0)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.1.0...v0.2.0)</sub>

## v0.1.0 (2024-08-23)
## [v0.1.0](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.1.0) (2024-08-23)

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.0.2...v0.1.0)
#### Changed

**Changed**
- some various improvements [\#2](https://github.com/fabien-marty/github-next-semantic-version/pull/2) ([fabien-marty](https://github.com/fabien-marty))

## v0.0.2 (2024-06-24)
<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.0.2...v0.1.0)</sub>

## [v0.0.2](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.0.2) (2024-06-24)

<sub>[Full Diff](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.0.1...v0.0.2)</sub>

[Full Changelog](https://github.com/fabien-marty/github-next-semantic-version/compare/v0.0.1...v0.0.2)
## [v0.0.1](https://github.com/fabien-marty/github-next-semantic-version/tree/v0.0.1) (2024-06-24)

## v0.0.1 (2024-06-24)
#### Changed

**Changed**
- Various changes [\#1](https://github.com/fabien-marty/github-next-semantic-version/pull/1) ([fabien-marty](https://github.com/fabien-marty))

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ # v1.10.1 is the next version
>
> - a dedicated GitHub Action in [this dedicated repository](https://github.com/fabien-marty/github-next-semantic-version-action) *if you want to use this tool inside a GHA workflow*
> - another CLI binary: `github-create-next-semantic-release` *(in this current repository)* to use the previous rules to automatically create a GitHub release with the guessed version and the corresponding release notes *(made from merged PRs and a configurable template)*
> - another GitHub Action in [this other repository](https://github.com/fabien-marty/github-create-next-semantic-release) *if you want to use this alternate tool: `github-create-next-semantic-release` inside a GHA workflow*
> - another GitHub Action in [this other repository](https://github.com/fabien-marty/github-create-next-semantic-release-action) *if you want to use this alternate tool: `github-create-next-semantic-release` inside a GHA workflow*
> - a full changelog generator CLI: `github-generate-changelog` (configurable by a [golang text/template](https://pkg.go.dev/text/template))
## Features
Expand Down
2 changes: 1 addition & 1 deletion README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ # v1.10.1 is the next version
>
> - a dedicated GitHub Action in [this dedicated repository](https://github.com/fabien-marty/github-next-semantic-version-action) *if you want to use this tool inside a GHA workflow*
> - another CLI binary: `github-create-next-semantic-release` *(in this current repository)* to use the previous rules to automatically create a GitHub release with the guessed version and the corresponding release notes *(made from merged PRs and a configurable template)*
> - another GitHub Action in [this other repository](https://github.com/fabien-marty/github-create-next-semantic-release) *if you want to use this alternate tool: `github-create-next-semantic-release` inside a GHA workflow*
> - another GitHub Action in [this other repository](https://github.com/fabien-marty/github-create-next-semantic-release-action) *if you want to use this alternate tool: `github-create-next-semantic-release` inside a GHA workflow*
> - a full changelog generator CLI: `github-generate-changelog` (configurable by a [golang text/template](https://pkg.go.dev/text/template))

## Features
Expand Down
27 changes: 12 additions & 15 deletions internal/app/changelog/changelog-default-template.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# CHANGELOG


{{- $security := dict "title" "Security" "match" "one-of-these" "labels" (list "Type: Security" "security") }}
{{ $security := dict "title" "Security" "match" "one-of-these" "labels" (list "Type: Security" "security") }}
{{- $added := dict "title" "Added" "match" "one-of-these" "labels" (list "Type: Feature" "feature") }}
{{- $fixed := dict "title" "Fixed" "match" "one-of-these" "labels" (list "Type: Bug" "bug") }}
{{- $deprecated := dict "title" "Deprecated" "match" "one-of-these" "labels" (list "Type: Deprecated" "deprecated") }}
Expand All @@ -12,20 +9,14 @@
{{- $groups := list $security $added $fixed $deprecated $removed $changed }}
{{- $reversedSections := .ReversedSections }}
{{- $repoOwner := .RepoOwner }}
{{- $repoName := .RepoName }}
{{- range $i, $section := $reversedSections }}
{{- $repoName := .RepoName -}}
# CHANGELOG
{{ range $i, $section := $reversedSections }}
{{- if $section.Tag }}
## {{ $section.Tag.Name }} ({{ $section.Tag.Time.Format "2006-01-02" }})
## [{{ $section.Tag.Name }}](https://github.com/{{ $repoOwner }}/{{ $repoName }}/tree/{{ $section.Tag.Name }}) ({{ $section.Tag.Time.Format "2006-01-02" }})
{{- else }}
## Future version **(not released)**
{{- end }}
{{- if lt $i (sub (len $reversedSections) 1) }}
{{- if $section.Tag }}
{{- $previousSection := index $reversedSections (add $i 1) }}

[Full Changelog](https://github.com/{{ $repoOwner }}/{{ $repoName }}/compare/{{ $previousSection.Tag.Name }}...{{ $section.Tag.Name }})
{{- end }}
{{- end }}
{{- range $group := $groups }}
{{- $prs := list }}
{{- if eq $group.match "one-of-these" }}
Expand All @@ -35,10 +26,16 @@
{{- end }}
{{- if $prs }}

**{{ $group.title }}**
#### {{ $group.title }}{{ print "\n" }}
{{- range $pr := $prs }}
- {{ $pr.Title }} [\#{{ $pr.Number }}]({{ $pr.Url }}) ([{{ $pr.AuthorLogin }}]({{ $pr.AuthorUrl }}))
{{- end }}
{{- end }}
{{- end }}
{{- if lt $i (sub (len $reversedSections) 1) }}
{{- if $section.Tag }}
{{- $previousSection := index $reversedSections (add $i 1) }}{{ print "\n" }}
<sub>[Full Diff](https://github.com/{{ $repoOwner }}/{{ $repoName }}/compare/{{ $previousSection.Tag.Name }}...{{ $section.Tag.Name }})</sub>
{{- end }}
{{- end }}
{{ end -}}

0 comments on commit bba19da

Please sign in to comment.