fix(ci): display only latest changelog in commit #16
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.md | |
on: | |
push: | |
branches: | |
- 'v3' | |
paths-ignore: | |
- '.vscode/**' | |
- '**/*.md' | |
jobs: | |
changelog: | |
name: Generate changelog | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate full changelog | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: --verbose | |
env: | |
OUTPUT: CHANGELOG.md | |
GITHUB_REPO: ${{ github.repository }} | |
- name: Generate changelog for latest commits | |
uses: orhun/git-cliff-action@v4 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: -vv --latest --strip header | |
env: | |
OUTPUT: CHANGES.md | |
GITHUB_REPO: ${{ github.repository }} | |
- name: Commit | |
run: | | |
git checkout v3 | |
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 "ci: update changelog" -m "${{ steps.git-cliff.outputs.content }}" | |
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/27rogi/website.git v3 |