ci: fix email for commitizenbot #1113
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: Bump version | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| bump-version: | |
| if: ${{ github.repository == 'commitizen-tools/commitizen' && !startsWith(github.event.head_commit.message, 'bump:') }} | |
| runs-on: ubuntu-latest | |
| name: "Bump version and create changelog with commitizen" | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.PRIVATE_KEY }} | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| persist-credentials: false | |
| - uses: commitizen-tools/setup-cz@main | |
| with: | |
| # Information extracted from the app token | |
| # Under actions/create-github-app-token is documented how to generate username and email for the bot | |
| # The hardcoded number is the user ID of the bot account, found in the bot API | |
| git-user-name: "${{ steps.app-token.outputs.app-slug }}[bot]" | |
| git-user-email: "274190853+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" | |
| - id: bump-version | |
| run: | | |
| cz bump --yes | |
| git push --follow-tags | |
| new_version="$(cz version -p)" | |
| echo "new_version=$new_version" >> $GITHUB_OUTPUT | |
| new_version_tag="$(cz version -p --tag)" | |
| echo "new_version_tag=$new_version_tag" >> $GITHUB_OUTPUT | |
| - name: Build changelog for Release | |
| env: | |
| NEW_VERSION: ${{ steps.bump-version.outputs.new_version }} | |
| run: | | |
| cz changelog --dry-run "${NEW_VERSION}" > .changelog.md | |
| - name: Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| NEW_VERSION_TAG: ${{ steps.bump-version.outputs.new_version_tag }} | |
| run: | | |
| gh release create "${NEW_VERSION_TAG}" --notes-file .changelog.md |