Skip to content

Commit 2ff6410

Browse files
author
colyerdeng
committed
refactor: update bump_version workflow
1. Remove setup.yaml dependency 2. Add Python and uv setup steps 3. Use github.token consistently
1 parent 5c645df commit 2ff6410

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

.github/workflows/bump_version.yaml

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

2424
jobs:
25-
setup:
26-
uses: ./.github/workflows/setup.yaml
27-
secrets: inherit
28-
2925
bump-version:
3026
if: "!startsWith(github.event.head_commit.message, 'bump:')"
31-
needs: setup
3227
runs-on: ubuntu-latest
3328
name: "Bump version and create changelog with commitizen"
3429
steps:
35-
- name: Debug token (bump-version job)
36-
run: |
37-
echo "Token from setup job is set: ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN != '' }}"
38-
3930
- name: Check out
4031
uses: actions/checkout@v4
4132
with:
4233
fetch-depth: 0
4334
token: ${{ github.token }}
4435

36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.12"
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v5
43+
44+
- name: Install dependencies
45+
run: uv sync --extra=dev
46+
4547
- id: cz
4648
name: Create bump and changelog
4749
uses: commitizen-tools/commitizen-action@master

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,33 @@ permissions:
2222
pull-requests: write # 用于创建 PR
2323

2424
jobs:
25-
setup:
26-
uses: ./.github/workflows/setup.yaml
27-
secrets: inherit
28-
2925
bump-version:
3026
if: "!startsWith(github.event.head_commit.message, 'bump:')"
31-
needs: setup
3227
runs-on: ubuntu-latest
3328
name: "Bump version and create changelog with commitizen"
3429
steps:
3530
- name: Check out
3631
uses: actions/checkout@v4
3732
with:
3833
fetch-depth: 0
39-
token: ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
34+
token: ${{ github.token }}
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.12"
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v5
43+
44+
- name: Install dependencies
45+
run: uv sync --extra=dev
4046

4147
- id: cz
4248
name: Create bump and changelog
4349
uses: commitizen-tools/commitizen-action@master
4450
with:
45-
github_token: ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
51+
github_token: ${{ github.token }}
4652
changelog_increment_filename: body.md
4753
increment: ${{ github.event.inputs.increment }}
4854

@@ -52,4 +58,4 @@ jobs:
5258
body_path: body.md
5359
tag_name: ${{ env.REVISION }}
5460
env:
55-
GITHUB_TOKEN: ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
61+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)