File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,10 +41,18 @@ jobs:
4141 token : ${{ secrets.GITHUB_TOKEN }}
4242
4343 - name : Install git-cliff
44- uses : orhun/git-cliff-action@v3
45- with :
46- config : cliff.toml
47- args : --output CHANGELOG.md
44+ run : |
45+ set -euo pipefail
46+ VERSION="2.6.1"
47+ ARCHIVE="git-cliff-${VERSION}-x86_64-unknown-linux-gnu.tar.gz"
48+ curl -sSLf -o "${ARCHIVE}" \
49+ "https://github.com/orhun/git-cliff/releases/download/v${VERSION}/${ARCHIVE}"
50+ tar -xzf "${ARCHIVE}"
51+ sudo install -m 0755 "git-cliff-${VERSION}/git-cliff" /usr/local/bin/git-cliff
52+ git cliff --version
53+
54+ - name : Regenerate CHANGELOG.md
55+ run : git cliff --config cliff.toml --output CHANGELOG.md
4856
4957 - name : Commit updated changelog
5058 run : |
Original file line number Diff line number Diff line change @@ -14,34 +14,35 @@ every push to `main` — do not edit it by hand.
1414"""
1515
1616body = """
17- {% if version -%}
17+
1818---
1919
20+ {% if version -%}
2021## 🏷️ {{ version | trim_start_matches(pat="v") }} — {{ timestamp | date(format="%Y-%m-%d") }}
2122{% else -%}
22- ---
23-
2423## 🔮 Unreleased
2524{% endif %}
2625{%- set breaking = commits | filter(attribute="breaking", value=true) -%}
2726{%- if breaking | length > 0 %}
2827
2928> ⚠️ **BREAKING CHANGES** — this release contains backwards-incompatible changes.
3029{% for commit in breaking -%}
31- > - {{ commit.message | split(pat="\n ") | first | trim | upper_first }}
30+ > - {{ commit.message | split(pat="\n ") | first | trim | truncate(length=140, end="…") | upper_first }}
3231{% endfor -%}
3332{% endif -%}
3433{% for group, commits in commits | group_by(attribute="group") %}
3534
3635### {{ group }}
36+
3737{% for commit in commits -%}
3838- {% if commit.scope -%}**`{{ commit.scope }}`** — {% endif -%}
39- {{ commit.message | split(pat="\n ") | first | trim | upper_first }}{% if commit.breaking %} ⚠️{% endif %}
39+ {{ commit.message | split(pat="\n ") | first | trim | truncate(length=140, end="…") | upper_first }}{% if commit.breaking %} ⚠️{% endif %}
4040{% endfor -%}
4141{% endfor %}
4242"""
4343
4444footer = """
45+
4546---
4647<sub>Generated by [git-cliff](https://github.com/orhun/git-cliff) 🦀 — Keep a Changelog format.</sub>
4748"""
You can’t perform that action at this time.
0 commit comments