Skip to content

Commit

Permalink
ci: auto generate changelog (argoproj#2321)
Browse files Browse the repository at this point in the history
* Auto changelogs

Signed-off-by: zachaller <[email protected]>

* change template

Signed-off-by: zachaller <[email protected]>

* remove pr title check to won pr

Signed-off-by: zachaller <[email protected]>

* conventionalcommits

Signed-off-by: zachaller <[email protected]>

* change file name

Signed-off-by: zachaller <[email protected]>

* Auto changelogs

Signed-off-by: zachaller <[email protected]>

* change template

Signed-off-by: zachaller <[email protected]>

* remove pr title check to won pr

Signed-off-by: zachaller <[email protected]>

* conventionalcommits

Signed-off-by: zachaller <[email protected]>

* change file name

Signed-off-by: zachaller <[email protected]>

* fix file name when untar'ing

Signed-off-by: zachaller <[email protected]>

* perms for clomonitor

Signed-off-by: zachaller <[email protected]>

* sort by semver

Signed-off-by: zachaller <[email protected]>

* start at v1.3.1

Signed-off-by: zachaller <[email protected]>

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller authored and jandersen-plaid committed Nov 26, 2022
1 parent 1adc649 commit f4ba61d
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .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 .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
28 changes: 28 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/argoproj/argo-rollouts
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
32 changes: 32 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Changelog
on:
release:
types: [published]
permissions:
contents: read

jobs:
updateChangelog:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update Changelog
run: |
curl -o git-chglog.tar.gz -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_darwin_amd64.tar.gz
tar -zxvf git-chglog.tar.gz
chmod u+x git-chglog
./git-chglog --sort semver -o CHANGELOG-AUTO.md v1.3.1..
rm git-chglog
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: update changelog
title: "docs: Update Changelog"
body: Update changelog to reflect release changes
branch: update-changelog
base: master

0 comments on commit f4ba61d

Please sign in to comment.