diff --git a/.github/workflows/bump_version.yaml b/.github/workflows/bump_version.yaml index de2b7c8..d9a2867 100644 --- a/.github/workflows/bump_version.yaml +++ b/.github/workflows/bump_version.yaml @@ -22,7 +22,15 @@ permissions: pull-requests: write # 用于创建 PR jobs: + setup: + uses: ./.github/workflows/setup.yaml + secrets: inherit + with: + python-version: "3.12" + install-deps: "none" # 我们不需要安装依赖,因为 commitizen-action 会处理 + bump-version: + needs: setup if: "!startsWith(github.event.head_commit.message, 'bump:')" runs-on: ubuntu-latest name: "Bump version and create changelog with commitizen" @@ -31,13 +39,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} - id: cz name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} changelog_increment_filename: body.md increment: ${{ github.event.inputs.increment }} @@ -47,4 +55,4 @@ jobs: body_path: body.md tag_name: ${{ env.REVISION }} env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/bump_version.yaml b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/bump_version.yaml index de2b7c8..af62417 100644 --- a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/bump_version.yaml +++ b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/bump_version.yaml @@ -22,7 +22,15 @@ permissions: pull-requests: write # 用于创建 PR jobs: + setup: + uses: ./.github/workflows/setup.yaml + secrets: inherit + with: + python-version: "{{cookiecutter.max_python_version}}" + install-deps: "none" # 我们不需要安装依赖,因为 commitizen-action 会处理 + bump-version: + needs: setup if: "!startsWith(github.event.head_commit.message, 'bump:')" runs-on: ubuntu-latest name: "Bump version and create changelog with commitizen" @@ -31,13 +39,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} - id: cz name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} changelog_increment_filename: body.md increment: ${{ github.event.inputs.increment }} @@ -47,4 +55,4 @@ jobs: body_path: body.md tag_name: ${{ env.REVISION }} env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/setup.yaml b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/setup.yaml index 138edcf..149a7e7 100644 --- a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/setup.yaml +++ b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/setup.yaml @@ -1,12 +1,11 @@ name: Reusable Setup - on: workflow_call: inputs: python-version: required: false type: string - default: "{{cookiecutter.max_python_version}}" + default: "3.12" install-deps: required: false type: string