diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4723f1..967bcf8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: # yamllint disable-line rule:truthy permissions: contents: write id-token: write + pull-requests: read jobs: release: runs-on: ubuntu-latest @@ -34,6 +35,8 @@ jobs: id: git-cliff # yamllint disable-line rule:line-length uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # ratchet:orhun/git-cliff-action@v4.8.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: --current - name: Create GitHub Release diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..66c4061 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,56 @@ +[changelog] +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }} \ + ([`{{ commit.id | truncate(length=7, end="") }}`]\ + (https://github.com/benner/commit-guard/commit/{{ commit.id }}))\ + {% endfor %} +{% endfor %} +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} + +### New Contributors +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} + - @{{ contributor.username }} made their first contribution\ + {% if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]\ + (https://github.com/benner/commit-guard/pull/{{ contributor.pr_number }})\ + {% endif %} +{% endfor %} +{%- endif %} +""" +trim = true + +[remote.github] +owner = "benner" +repo = "commit-guard" + +[git] +conventional_commits = true +filter_unconventional = true +split_commits = false +protect_breaking_commits = false +commit_parsers = [ + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^docs", skip = true }, + { message = "^ci", skip = true }, + { message = "^chore", group = "โš™๏ธ Miscellaneous Tasks" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, +] +filter_commits = true +topo_order = false +sort_commits = "oldest"