Skip to content

Commit c79f108

Browse files
ci: update github bump version git hub action
1 parent b9e10be commit c79f108

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/bump_version.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ permissions:
2222
pull-requests: write # 用于创建 PR
2323

2424
jobs:
25+
setup:
26+
uses: ./.github/workflows/setup.yaml
27+
secrets: inherit
28+
with:
29+
python-version: "3.12"
30+
install-deps: "none" # 我们不需要安装依赖,因为 commitizen-action 会处理
31+
2532
bump-version:
33+
needs: setup
2634
if: "!startsWith(github.event.head_commit.message, 'bump:')"
2735
runs-on: ubuntu-latest
2836
name: "Bump version and create changelog with commitizen"
@@ -31,13 +39,13 @@ jobs:
3139
uses: actions/checkout@v4
3240
with:
3341
fetch-depth: 0
34-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
42+
token: ${{ secrets.GITHUB_TOKEN }}
3543

3644
- id: cz
3745
name: Create bump and changelog
3846
uses: commitizen-tools/commitizen-action@master
3947
with:
40-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
4149
changelog_increment_filename: body.md
4250
increment: ${{ github.event.inputs.increment }}
4351

@@ -47,4 +55,4 @@ jobs:
4755
body_path: body.md
4856
tag_name: ${{ env.REVISION }}
4957
env:
50-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/bump_version.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ permissions:
2222
pull-requests: write # 用于创建 PR
2323

2424
jobs:
25+
setup:
26+
uses: ./.github/workflows/setup.yaml
27+
secrets: inherit
28+
with:
29+
python-version: "{{cookiecutter.max_python_version}}"
30+
install-deps: "none" # 我们不需要安装依赖,因为 commitizen-action 会处理
31+
2532
bump-version:
33+
needs: setup
2634
if: "!startsWith(github.event.head_commit.message, 'bump:')"
2735
runs-on: ubuntu-latest
2836
name: "Bump version and create changelog with commitizen"
@@ -31,13 +39,13 @@ jobs:
3139
uses: actions/checkout@v4
3240
with:
3341
fetch-depth: 0
34-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
42+
token: ${{ secrets.GITHUB_TOKEN }}
3543

3644
- id: cz
3745
name: Create bump and changelog
3846
uses: commitizen-tools/commitizen-action@master
3947
with:
40-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
4149
changelog_increment_filename: body.md
4250
increment: ${{ github.event.inputs.increment }}
4351

@@ -47,4 +55,4 @@ jobs:
4755
body_path: body.md
4856
tag_name: ${{ env.REVISION }}
4957
env:
50-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)