Skip to content

Commit 7e28df7

Browse files
committed
fix: Replace git-cliff-action with native git log for release notes
- Remove dependency on orhun/git-cliff-action which has Docker build issues - Use native git log to generate release notes from commits - Maintain same format with commit links and changelog structure - Fix release workflow to work reliably in CI environment
1 parent 11b14e1 commit 7e28df7

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -77,30 +77,30 @@ jobs:
7777
7878
- name: Generate release notes
7979
id: release_notes
80-
uses: orhun/git-cliff-action@v2
81-
with:
82-
config: |
83-
[changelog]
84-
header = """
85-
# Changelog
86-
"""
87-
body = """
88-
{% if version %}
89-
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
90-
{% else %}
91-
## [unreleased]
92-
{% endif %}
93-
{% for group, commits in commits | group_by(attribute="group") %}
94-
### {{ group | upper_first }}
95-
{% for commit in commits %}
96-
- {{ commit.message | upper_first }} ([`{{ commit.id | truncate(length=7, end="") }}`](https://github.com/${{ github.repository }}/commit/{{ commit.id }}))
97-
{% endfor %}
98-
{% endfor %}
99-
"""
100-
footer = ""
101-
tag: ${{ steps.version.outputs.new_version }}
102-
env:
103-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: |
81+
# Get the latest tag
82+
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
83+
84+
# Generate release notes from commits since last tag
85+
echo "## What's Changed" > release_notes.md
86+
echo "" >> release_notes.md
87+
88+
# Get commits since last tag
89+
if [ "$latest_tag" != "v0.0.0" ]; then
90+
git log --pretty=format:"- %s ([%h](https://github.com/${{ github.repository }}/commit/%H))" ${latest_tag}..HEAD >> release_notes.md
91+
else
92+
git log --pretty=format:"- %s ([%h](https://github.com/${{ github.repository }}/commit/%H))" >> release_notes.md
93+
fi
94+
95+
echo "" >> release_notes.md
96+
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${latest_tag}...${{ steps.version.outputs.new_version }}" >> release_notes.md
97+
98+
# Set output
99+
{
100+
echo 'content<<EOF'
101+
cat release_notes.md
102+
echo EOF
103+
} >> $GITHUB_OUTPUT
104104
105105
- name: Update CHANGELOG.md
106106
run: |

0 commit comments

Comments
 (0)