Skip to content

chore(cliff): Fix branch name (changelog will be in "main" branch) #14

chore(cliff): Fix branch name (changelog will be in "main" branch)

chore(cliff): Fix branch name (changelog will be in "main" branch) #14

name: ✍ Generate Changelog / Release notes (git-cliff)
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for specific branches
push:
branches: [ main ]
paths-ignore:
- 'CHANGELOG.m**' # To prevent infinite trigger
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# https://github.com/orhun/git-cliff/blob/main/website/docs/github-actions/git-cliff-action.md
run-changelog-generator:
name: Run Changelog Generator (git-cliff)
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest repo update
uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/orhun/git-cliff-action/tree/main#usage
- name: ✍ Generate changelog
uses: orhun/git-cliff-action@v3
with:
# config file location
config: cliff.toml
# git-cliff arguments - https://git-cliff.org/docs/usage/args
args: --bump -v # optional, default is -v
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
# https://github.com/orhun/git-cliff-action/tree/main#committing-the-changelog
- name: 🚀 Commit generated changelog
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "🤖 Regenerate changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git main