lprs/.forgejo/workflows/changelog.yml
awiteb cdfeed7913
All checks were successful
Write changelog / write-changelog (push) Successful in 3s
Rust CI / Rust CI (push) Successful in 1m15s
chore: Fix changelog ci
2024-04-25 00:43:04 +02:00

37 lines
1.1 KiB
YAML

name: Write changelog
on:
push:
branches:
- 'master'
jobs:
write-changelog:
runs-on: debian
steps:
- uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
fetch-tags: true
- name: Install git-cliff
run: |
version="2.2.1"
wget "https://github.com/orhun/git-cliff/releases/download/v$version/git-cliff-$version-x86_64-unknown-linux-gnu.tar.gz"
tar -xvzf git-cliff-*.tar.gz
mv "git-cliff-$version/git-cliff" /usr/local/bin
rm -fr git-cliff-*
- name: Write changelog
run: |
git config user.name forgejo-actions
git config user.email forgejo-actions@noreply.localhost
git config --unset-all extensions.worktreeconfig
git-cliff > CHANGELOG.md
if [[ $(git status | grep --extended-regexp '^\s+modified:\s+CHANGELOG.md$') ]]; then
git add CHANGELOG.md
git commit -m "chore(changelog): Update changelog"
git push
echo "Changelog updated"
else
echo "No changes to changelog"
fi