feat(ci): Add changelog workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update CHANGELOG | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
git-cliff-action: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v2 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: --verbose | |
env: | |
OUTPUT: CHANGELOG.md | |
- name: Set github-actions bot config | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Commit and push CHANGELOG, only if there are any changes | |
run: | | |
if [[ -n $(git status -s) ]]; then | |
git add CHANGELOG.md | |
git commit -m "Update CHANGELOG" | |
git push origin HEAD | |
fi |