Skip to content

Commit

Permalink
ci: update git-cliff Github Action
Browse files Browse the repository at this point in the history
Run git-cliff after the release to ensure that the latest changes are incroporated; update Github Action to new v3 according to the official Github Action readme (https://github.com/orhun/git-cliff-action?tab=readme-ov-file#committing-the-changelog)
  • Loading branch information
nicrie committed Aug 30, 2024
1 parent 9188ef2 commit f8b3305
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/release_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,10 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
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: docs/whats_new/CHANGELOG.md

- name: Add Changelog
run: |
git add docs/whats_new/CHANGELOG.md

# This action uses Python Semantic Release v8
- name: Python Semantic Release
Expand All @@ -55,3 +43,23 @@ jobs:
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Update Changelog; this must be done after the release
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: docs/whats_new/CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Commit Changelog
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add docs/whats_new/CHANGELOG.md
git commit -m "docs(changelog): update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git main
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[changelog]
# changelog header
header = """
# Changelog\n
# News\n
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.\n
"""
# template for the changelog body
Expand Down

0 comments on commit f8b3305

Please sign in to comment.