Skip to content

Commit d88a7d4

Browse files
fix: use token from setup workflow in bump_version workflow
1 parent a81477f commit d88a7d4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/bump_version.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
34-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
34+
token: ${{ needs.setup.outputs.personal-access-token || github.token }}
3535

3636
- id: cz
3737
name: Create bump and changelog
3838
uses: commitizen-tools/commitizen-action@master
3939
with:
40-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
40+
github_token: ${{ needs.setup.outputs.personal-access-token || github.token }}
4141
changelog_increment_filename: body.md
4242
increment: ${{ github.event.inputs.increment }}
4343

@@ -47,4 +47,4 @@ jobs:
4747
body_path: body.md
4848
tag_name: ${{ env.REVISION }}
4949
env:
50-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
50+
GITHUB_TOKEN: ${{ needs.setup.outputs.personal-access-token || github.token }}

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

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

2424
jobs:
25+
setup:
26+
uses: ./.github/workflows/setup.yaml
27+
secrets: inherit
28+
2529
bump-version:
2630
if: "!startsWith(github.event.head_commit.message, 'bump:')"
31+
needs: setup
2732
runs-on: ubuntu-latest
2833
name: "Bump version and create changelog with commitizen"
2934
steps:
3035
- name: Check out
3136
uses: actions/checkout@v4
3237
with:
3338
fetch-depth: 0
34-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
39+
token: ${{ needs.setup.outputs.personal-access-token || github.token }}
3540

3641
- id: cz
3742
name: Create bump and changelog
3843
uses: commitizen-tools/commitizen-action@master
3944
with:
40-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
45+
github_token: ${{ needs.setup.outputs.personal-access-token || github.token }}
4146
changelog_increment_filename: body.md
4247
increment: ${{ github.event.inputs.increment }}
4348

@@ -47,4 +52,4 @@ jobs:
4752
body_path: body.md
4853
tag_name: ${{ env.REVISION }}
4954
env:
50-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
55+
GITHUB_TOKEN: ${{ needs.setup.outputs.personal-access-token || github.token }}

0 commit comments

Comments
 (0)