File tree Expand file tree Collapse file tree 8 files changed +34
-16
lines changed
repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows Expand file tree Collapse file tree 8 files changed +34
-16
lines changed Original file line number Diff line number Diff line change @@ -22,29 +22,34 @@ permissions:
22
22
pull-requests : write # 用于创建 PR
23
23
24
24
jobs :
25
+ setup :
26
+ uses : ./.github/workflows/setup.yaml
27
+ secrets : inherit
28
+
25
29
bump-version :
26
30
if : " !startsWith(github.event.head_commit.message, 'bump:')"
31
+ needs : setup
27
32
runs-on : ubuntu-latest
28
33
name : " Bump version and create changelog with commitizen"
29
34
steps :
30
35
- name : Check out
31
36
uses : actions/checkout@v4
32
37
with :
33
38
fetch-depth : 0
34
- token : ${{ needs.setup.outputs.personal-access-token || github.token }}
39
+ token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
35
40
36
41
- id : cz
37
42
name : Create bump and changelog
38
43
uses : commitizen-tools/commitizen-action@master
39
44
with :
40
- github_token : ${{ needs.setup.outputs.personal-access-token || github.token }}
45
+ github_token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
41
46
changelog_increment_filename : body.md
42
47
increment : ${{ github.event.inputs.increment }}
43
48
44
- - name : Release
45
- uses : softprops/action-gh-release@v1
49
+ - name : Create Release
50
+ uses : softprops/action-gh-release@v2
46
51
with :
47
52
body_path : body.md
48
53
tag_name : ${{ env.REVISION }}
49
54
env :
50
- GITHUB_TOKEN : ${{ needs.setup.outputs.personal-access-token || github.token }}
55
+ GITHUB_TOKEN : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
Original file line number Diff line number Diff line change 17
17
secrets :
18
18
OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
19
19
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20
+ outputs :
21
+ PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20
22
21
23
deploy :
22
24
needs : setup
25
27
- name : Build and deploy documentation
26
28
run : uvx mkdocs gh-deploy --force
27
29
env :
28
- GITHUB_TOKEN : ${{ secrets. PERSONAL_ACCESS_TOKEN }}
30
+ GITHUB_TOKEN : ${{ needs.setup.outputs. PERSONAL_ACCESS_TOKEN || github.token }}
Original file line number Diff line number Diff line change 24
24
secrets :
25
25
OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
26
26
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27
+ outputs :
28
+ personal-access-token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27
29
28
30
build :
29
31
needs : setup
39
41
id : create_release
40
42
uses : softprops/action-gh-release@v2
41
43
with :
44
+ token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN || github.token }}
42
45
tag_name : ${{ github.event.inputs.version || github.ref_name }}
43
46
draft : false
44
47
prerelease : false
Original file line number Diff line number Diff line change 19
19
python-version :
20
20
description : " The Python version that was set up"
21
21
value : ${{ jobs.setup.outputs.python-version }}
22
+ PERSONAL_ACCESS_TOKEN :
23
+ description : " The personal access token"
24
+ value : ${{ jobs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
22
25
23
26
jobs :
24
27
setup :
25
28
runs-on : ubuntu-latest
26
29
outputs :
27
30
python-version : ${{ steps.setup-python.outputs.python-version }}
31
+ PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
28
32
steps :
29
33
- name : Load secret
30
34
if : ${{ inputs.install-deps != 'none' }}
Original file line number Diff line number Diff line change @@ -36,20 +36,20 @@ jobs:
36
36
uses : actions/checkout@v4
37
37
with :
38
38
fetch-depth : 0
39
- token : ${{ needs.setup.outputs.personal-access-token || github.token }}
39
+ token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
40
40
41
41
- id : cz
42
42
name : Create bump and changelog
43
43
uses : commitizen-tools/commitizen-action@master
44
44
with :
45
- github_token : ${{ needs.setup.outputs.personal-access-token || github.token }}
45
+ github_token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
46
46
changelog_increment_filename : body.md
47
47
increment : ${{ github.event.inputs.increment }}
48
48
49
- - name : Release
50
- uses : softprops/action-gh-release@v1
49
+ - name : Create Release
50
+ uses : softprops/action-gh-release@v2
51
51
with :
52
52
body_path : body.md
53
53
tag_name : ${{ env.REVISION }}
54
54
env :
55
- GITHUB_TOKEN : ${{ needs.setup.outputs.personal-access-token || github.token }}
55
+ GITHUB_TOKEN : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
Original file line number Diff line number Diff line change 15
15
uses : ./.github/workflows/setup.yaml
16
16
with :
17
17
install-deps : docs
18
- python-version : " {{ cookiecutter.max_python_version }}"
19
- secrets :
20
- OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
21
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18
+ secrets : inherit
22
19
23
20
deploy :
24
21
needs : setup
27
24
- name : Build and deploy documentation
28
25
run : uvx mkdocs gh-deploy --force
29
26
env :
30
- GITHUB_TOKEN : ${{ secrets. PERSONAL_ACCESS_TOKEN }}
27
+ GITHUB_TOKEN : ${{ needs.setup.outputs. PERSONAL_ACCESS_TOKEN || github.token }}
31
28
{% endif %}
Original file line number Diff line number Diff line change 24
24
secrets :
25
25
OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
26
26
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27
+ outputs :
28
+ personal-access-token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27
29
28
30
build :
29
31
needs : setup
39
41
id : create_release
40
42
uses : softprops/action-gh-release@v2
41
43
with :
44
+ token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN || github.token }}
42
45
tag_name : ${{ github.event.inputs.version || github.ref_name }}
43
46
draft : false
44
47
prerelease : false
Original file line number Diff line number Diff line change 20
20
python-version :
21
21
description : " The Python version that was set up"
22
22
value : ${{ jobs.setup.outputs.python-version }}
23
+ PERSONAL_ACCESS_TOKEN :
24
+ description : " The personal access token"
25
+ value : ${{ jobs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
23
26
24
27
jobs :
25
28
setup :
26
29
runs-on : ubuntu-latest
27
30
outputs :
28
31
python-version : ${{ steps.setup-python.outputs.python-version }}
32
+ PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
29
33
steps :
30
34
- name : Load secret
31
35
if : ${{ inputs.install-deps != 'none' }}
You can’t perform that action at this time.
0 commit comments