Skip to content

Commit 849ece2

Browse files
committed
ci: auto-update CHANGELOG.md on release
1 parent 88cf0ab commit 849ece2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ jobs:
219219
steps:
220220
- name: Checkout
221221
uses: actions/checkout@v4
222+
with:
223+
fetch-depth: 0
222224

223225
- name: Download all artifacts
224226
uses: actions/download-artifact@v4
@@ -243,3 +245,20 @@ jobs:
243245
artifacts/agcp-*.rpm
244246
env:
245247
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
248+
249+
- name: Generate full changelog
250+
uses: orhun/git-cliff-action@v4
251+
with:
252+
args: --tag v${{ needs.changelog.outputs.version }}
253+
env:
254+
GITHUB_REPO: ${{ github.repository }}
255+
OUTPUT: CHANGELOG.md
256+
257+
- name: Commit changelog to main
258+
run: |
259+
git config user.name "github-actions[bot]"
260+
git config user.email "github-actions[bot]@users.noreply.github.com"
261+
git add CHANGELOG.md
262+
git diff --cached --quiet && exit 0
263+
git commit -m "docs: update changelog for v${{ needs.changelog.outputs.version }}"
264+
git push origin HEAD:main

0 commit comments

Comments
 (0)