Generate Changelog #3
Workflow file for this run
This file contains hidden or 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: Generate Changelog | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to generate changelog for (e.g. v0.4.0)" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| changelog: | |
| name: Update CHANGELOG.md | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate CHANGELOG.md | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --output CHANGELOG.md --tag "${{ github.event.inputs.tag || github.ref_name }}" | |
| env: | |
| GITHUB_REPO: ${{ github.repository }} | |
| - name: Commit CHANGELOG.md | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add CHANGELOG.md | |
| git diff --cached --quiet || git commit -m "docs: update CHANGELOG.md for ${{ github.event.inputs.tag || github.ref_name }}" | |
| git push | |
| shell: bash |