Skip to content

Commit 5b42c56

Browse files
committed
fix(ci): use commitizen bot to push tags and commits
1 parent a06ce0c commit 5b42c56

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

.github/workflows/bumpversion.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,22 @@ jobs:
1414
contents: write
1515
actions: write
1616
steps:
17+
- uses: actions/create-github-app-token@v3
18+
id: app-token
19+
with:
20+
app-id: ${{ vars.APP_ID }}
21+
private-key: ${{ secrets.PRIVATE_KEY }}
1722
- name: Check out
1823
uses: actions/checkout@v6
1924
with:
25+
token: ${{ steps.app-token.outputs.token }}
2026
fetch-depth: 0
2127
fetch-tags: true
28+
persist-credentials: false
2229
- uses: commitizen-tools/setup-cz@main
30+
with:
31+
git-user-name: "${{ steps.app-token.outputs.app-slug }}[bot]"
32+
git-user-email: "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
2333
- id: bump-version
2434
run: |
2535
cz bump --yes
@@ -39,9 +49,3 @@ jobs:
3949
NEW_VERSION_TAG: ${{ steps.bump-version.outputs.new_version_tag }}
4050
run: |
4151
gh release create "${NEW_VERSION_TAG}" --notes-file .changelog.md
42-
- name: trigger other workflow
43-
env:
44-
GH_TOKEN: ${{ github.token }}
45-
run: |
46-
gh workflow run pythonpublish.yml \
47-
-f "version=${{ steps.bump-version.outputs.new_version_tag }}"

.github/workflows/pythonpublish.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
name: Upload Python Package
22

3-
# With the current configuration this workflow will be
4-
# triggered via `workflow_dispatch` in `bumpversion.yml`.
5-
# We leave the `push.tags` trigger to allow for manual releases
6-
# in case we need to bump locally, and we actively push the tag.
7-
# The PERSONAL_ACCESS_TOKEN is no longer needed as we use the OIDC token instead.
8-
# We favor this approach because it requires less steps to set up and is more secure.
3+
# The tag is now triggered by the Github App: CommitizenBot
94
on:
105
push:
116
tags:
127
- "v*"
13-
workflow_dispatch:
14-
inputs:
15-
version:
16-
description: "Version to trigger"
17-
required: true
188

199
jobs:
2010
deploy:
@@ -27,7 +17,7 @@ jobs:
2717
- uses: actions/checkout@v6
2818
with:
2919
fetch-depth: 0
30-
ref: ${{ inputs.version || github.ref_name }}
20+
ref: ${{ github.ref_name }}
3121
- name: Set up Python
3222
uses: astral-sh/setup-uv@v7
3323
- name: Build

docs/config/option.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Name of the committing rules to use. What we generally call the **commit convent
77
- Type: `str`
88
- Default: `"cz_conventional_commits"`
99
- Options
10-
- `cz_conventional_commits`: uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
11-
- `cz_jira`: jira [smart commits](https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/)
12-
- `cz_customize`: (**not recommended**) customize the convention directly in the `TOML` file under `[tool.commitizen.customize]`, read [Customize in configuration file](../customization/config_file.md) for more. There's a plan to provide a different functionality.
10+
- `cz_conventional_commits`: uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
11+
- `cz_jira`: jira [smart commits](https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/)
12+
- `cz_customize`: (**not recommended**) customize the convention directly in the `TOML` file under `[tool.commitizen.customize]`, read [Customize in configuration file](../customization/config_file.md) for more. There's a plan to provide a different functionality.
1313

1414
You can write your own convention, and release it on PyPI, check [Customizing through a Python class](../customization/python_class.md).
1515

0 commit comments

Comments
 (0)