Skip to content

Commit 38bebd6

Browse files
authored
#324 ci: auto-update CHANGELOG.md on release (#325)
Add automatic CHANGELOG.md update step after GitHub release creation. Changes: - Generate full CHANGELOG.md using git-cliff after release - Commit updated changelog back to main branch - Use [skip ci] flag to avoid triggering CI recursively This ensures CHANGELOG.md in repository stays synchronized with GitHub release notes and always reflects the latest version history.
1 parent c4b4a0a commit 38bebd6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/auto-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,27 @@ jobs:
203203
draft: false
204204
prerelease: false
205205

206+
- name: Update CHANGELOG.md
207+
if: steps.version_check.outputs.should_release == 'true' && steps.check_existing.outputs.release_exists == 'false'
208+
shell: bash
209+
run: |
210+
VERSION="${{ steps.local_version.outputs.version }}"
211+
212+
echo "Generating full CHANGELOG.md..."
213+
git cliff --config cliff.toml --output CHANGELOG.md
214+
215+
if git diff --quiet CHANGELOG.md; then
216+
echo "No changes to CHANGELOG.md, skipping commit"
217+
exit 0
218+
fi
219+
220+
git config user.name "github-actions[bot]"
221+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
222+
223+
git add CHANGELOG.md
224+
git commit -m "chore: update CHANGELOG.md for v${VERSION} [skip ci]"
225+
git push origin main
226+
206227
- name: Install Rust toolchain for publish
207228
if: steps.version_check.outputs.should_release == 'true'
208229
uses: dtolnay/rust-toolchain@v1

0 commit comments

Comments
 (0)