Generate Changelog #4
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., v1.0.0)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| changelog: | |
| name: Generate changelog | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate a changelog | |
| uses: orhun/git-cliff-action@v4 | |
| id: git-cliff | |
| with: | |
| config: .cliff.toml | |
| args: --verbose | |
| env: | |
| OUTPUT: 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 CHANGELOG.md | |
| git commit -m "docs(changelog): update changelog for ${{ github.ref_name }}" | |
| git push | |
| if: github.event_name == 'push' | |
| - name: Create Pull Request for manual changelog | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "docs(changelog): update changelog" | |
| title: "docs(changelog): update changelog" | |
| body: | | |
| ## Automated Changelog Update | |
| This PR updates the CHANGELOG.md file based on conventional commits. | |
| Generated by [git-cliff](https://git-cliff.org). | |
| branch: changelog-update | |
| delete-branch: true |