diff --git a/.codegen.json b/.codegen.json index fd308f7ef7..3e2cd7a6a5 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1,5 +1,6 @@ { "formatter": "make fmt", + "changelog_config": ".codegen/changelog_config.yml", "version": { "common/version.go": "version = \"$VERSION\"" }, diff --git a/.codegen/changelog.md.tmpl b/.codegen/changelog.md.tmpl index fdb4bcc388..290ea71170 100644 --- a/.codegen/changelog.md.tmpl +++ b/.codegen/changelog.md.tmpl @@ -1,22 +1,12 @@ # Version changelog ## {{.Version}} +{{- range .GroupChanges}} -### New Features and Improvements -{{range .Changes -}} +### {{.Type.Message}} +{{range .Changes}} * {{.}}. -{{end}} - -### Documentation Changes - -### Exporter - -### Internal Changes -{{if .DependencyUpdates}} -Dependency updates: -{{range .DependencyUpdates}} - * {{.}}. -{{- end -}} +{{- end}} {{end}} ## {{.PrevVersion}} \ No newline at end of file diff --git a/.codegen/changelog_config.yml b/.codegen/changelog_config.yml new file mode 100644 index 0000000000..ee86db8a7a --- /dev/null +++ b/.codegen/changelog_config.yml @@ -0,0 +1,15 @@ +change_types: + - message: New Features and Improvements + tag: "[Feature]" + - message: Bug Fixes + tag: "[Fix]" + - message: Documentation + tag: "[Doc]" + - message: Internal Changes + tag: "[Internal]" + - message: Dependency Updates + tag: "[Dependency]" + - message: Exporter + tag: "[Exporter]" + # Default for messages without a tag + - message: Other Changes \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3938344a7a..53ce671f4c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,5 @@ updates: directory: "/" schedule: interval: "daily" + commit-message: + prefix: "[Dependency] " \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4a6f8892d4..354747f208 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -54,3 +54,22 @@ jobs: run: | # Exit with status code 1 if there are differences (i.e. unformatted files) git diff --exit-code + + commit-message: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Validate Tag + run: | + TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p') + if grep -q "tag: \"[$TAG]\"" .codegen/changelog_config.yml; then + echo "Invalid or missing tag in commit message: [$TAG]" + exit 1 + else + echo "Valid tag found: [$TAG]" + fi \ No newline at end of file