Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Changelog Update PR

on:
push:
tags:
- "v[0-9]+.*"

permissions:
contents: write
pull-requests: write

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install git-cliff
uses: taiki-e/install-action@v2
with:
tool: git-cliff

- name: Determine tag metadata
id: tag
run: |
TAG="${GITHUB_REF#refs/tags/}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "branch=changelog/$TAG" >> "$GITHUB_OUTPUT"

- name: Generate changelog
run: git-cliff --config cliff.toml --output CHANGELOG.md

- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(release): update CHANGELOG for ${{ steps.tag.outputs.tag }}"
title: "chore(release): update CHANGELOG for ${{ steps.tag.outputs.tag }}"
branch: ${{ steps.tag.outputs.branch }}
delete-branch: true
labels: changelog, automated
draft: false
body: |
Automated changelog update for `${{ steps.tag.outputs.tag }}`.

Generated by [git-cliff](https://git-cliff.org/) via the `changelog.yml` workflow.
70 changes: 70 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# git-cliff configuration for oprf-nr
# https://git-cliff.org/docs/configuration

[changelog]
header = """
# Changelog

All notable changes to this project will be documented in this file.

"""
body = """
{%- macro remote_url() -%}
https://github.com/TaceoLabs/oprf-nr
{%- endmacro -%}

{% 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
| filter(attribute="scope")
| sort(attribute="scope") %}
- *({{ commit.scope }})* {{ commit.message | upper_first }} \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))
{%- endfor -%}
{% for commit in commits %}
{%- if not commit.scope %}
- {{ commit.message | upper_first }} \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))
{% endif -%}
{% endfor -%}
{% endfor %}
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true

[git]
conventional_commits = true
filter_unconventional = true
split_commits = false
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/TaceoLabs/oprf-nr/pull/${2}))" },
]
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^perf", group = "<!-- 2 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 3 -->🔧 Refactor" },
{ message = "^doc", group = "<!-- 4 -->📚 Documentation" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^chore\\(deps.*\\)", group = "<!-- 7 -->📦 Dependencies" },
{ message = "^chore|^ci", group = "<!-- 8 -->⚙️ Miscellaneous" },
{ body = ".*security", group = "<!-- 9 -->🔒 Security" },
{ message = "^revert", group = "<!-- 10 -->◀️ Reverts" },
]
protect_breaking_commits = false
filter_commits = false
topo_order = false
sort_commits = "oldest"
tag_pattern = "v[0-9].*"
skip_tags = ""
ignore_tags = ""
Loading