Skip to content

Commit fbbb542

Browse files
committed
ci: auto-update CHANGELOG.md on release
1 parent 6a18062 commit fbbb542

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
@@ -129,6 +129,8 @@ jobs:
129129
steps:
130130
- name: Checkout
131131
uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
132134

133135
- name: Download all artifacts
134136
uses: actions/download-artifact@v4
@@ -151,3 +153,20 @@ jobs:
151153
artifacts/agcp-v${{ needs.changelog.outputs.version }}-*.zip
152154
env:
153155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
157+
- name: Generate full changelog
158+
uses: orhun/git-cliff-action@v4
159+
with:
160+
args: --tag v${{ needs.changelog.outputs.version }}
161+
env:
162+
GITHUB_REPO: ${{ github.repository }}
163+
OUTPUT: CHANGELOG.md
164+
165+
- name: Commit changelog to main
166+
run: |
167+
git config user.name "github-actions[bot]"
168+
git config user.email "github-actions[bot]@users.noreply.github.com"
169+
git add CHANGELOG.md
170+
git diff --cached --quiet && exit 0
171+
git commit -m "docs: update changelog for v${{ needs.changelog.outputs.version }}"
172+
git push origin HEAD:main

0 commit comments

Comments
 (0)