2024-03-15 04:08:33 +01:00
|
|
|
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: |
|
2024-04-25 00:39:58 +02:00
|
|
|
version="2.2.1"
|
2024-03-15 04:08:33 +01:00
|
|
|
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
|
2024-04-25 00:43:04 +02:00
|
|
|
git config --unset-all extensions.worktreeconfig
|
2024-03-15 04:08:33 +01:00
|
|
|
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
|