File tree Expand file tree Collapse file tree 5 files changed +15
-56
lines changed Expand file tree Collapse file tree 5 files changed +15
-56
lines changed Original file line number Diff line number Diff line change 18
18
default : patch
19
19
20
20
permissions :
21
- contents : write # 用于创建和推送标签
22
- pull-requests : write # 用于创建 PR
21
+ contents : write
23
22
24
23
jobs :
25
24
setup :
@@ -36,13 +35,13 @@ jobs:
36
35
uses : actions/checkout@v4
37
36
with :
38
37
fetch-depth : 0
39
- token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
38
+ token : ${{ github.token }}
40
39
41
40
- id : cz
42
41
name : Create bump and changelog
43
42
uses : commitizen-tools/commitizen-action@master
44
43
with :
45
- github_token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
44
+ github_token : ${{ github.token }}
46
45
changelog_increment_filename : body.md
47
46
increment : ${{ github.event.inputs.increment }}
48
47
52
51
body_path : body.md
53
52
tag_name : ${{ env.REVISION }}
54
53
env :
55
- GITHUB_TOKEN : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
54
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change 14
14
uses : ./.github/workflows/setup.yaml
15
15
with :
16
16
install-deps : docs
17
- secrets :
18
- OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
19
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20
- outputs :
21
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
17
+ secrets : inherit
22
18
23
19
deploy :
24
20
needs : setup
27
23
- name : Build and deploy documentation
28
24
run : uvx mkdocs gh-deploy --force
29
25
env :
30
- GITHUB_TOKEN : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN || github.token }}
26
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change @@ -17,32 +17,22 @@ jobs:
17
17
uses : ./.github/workflows/setup.yaml
18
18
with :
19
19
install-deps : dev
20
- python-version : " 3.12" # 使用最新版本
21
- secrets :
22
- OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
23
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20
+ python-version : " 3.12"
21
+ secrets : inherit
24
22
25
- lint :
23
+ check :
26
24
needs : setup
27
25
runs-on : ubuntu-latest
28
26
steps :
29
27
- name : Checkout code
30
28
uses : actions/checkout@v4
31
29
32
- - name : Set up Python
33
- uses : actions/setup-python@v5
34
- with :
35
- python-version : " 3.12"
36
-
37
- - name : Install uv
38
- uses : astral-sh/setup-uv@v5
39
-
40
30
- name : Run lint checks
41
31
id : lint
42
32
run : uv tool run nox -s lint
43
33
continue-on-error : true
44
34
45
- - name : Comment on PR
35
+ - name : Comment on PR (Lint)
46
36
if : github.event_name == 'pull_request' && steps.lint.outcome == 'failure'
47
37
uses : actions/github-script@v7
48
38
with :
62
52
if : steps.lint.outcome == 'failure'
63
53
run : exit 1
64
54
65
- test-all :
66
- needs : setup
67
- runs-on : ubuntu-latest
68
- steps :
69
- - name : Checkout code
70
- uses : actions/checkout@v4
71
-
72
- - name : Set up Python
73
- uses : actions/setup-python@v5
74
- with :
75
- python-version : " 3.12"
76
-
77
- - name : Install uv
78
- uses : astral-sh/setup-uv@v5
79
-
80
- - name : Run tests on all Python versions
55
+ - name : Run tests
81
56
id : test
82
57
run : uv tool run nox -s test_all
83
58
continue-on-error : true
90
65
file : ./coverage.xml
91
66
flags : unittests
92
67
93
- - name : Comment on PR
68
+ - name : Comment on PR (Tests)
94
69
if : github.event_name == 'pull_request' && steps.test.outcome == 'failure'
95
70
uses : actions/github-script@v7
96
71
with :
Original file line number Diff line number Diff line change 21
21
with :
22
22
install-deps : dev
23
23
python-version : " 3.12"
24
- secrets :
25
- OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
26
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27
- outputs :
28
- personal-access-token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
24
+ secrets : inherit
29
25
30
26
build :
31
27
needs : setup
41
37
id : create_release
42
38
uses : softprops/action-gh-release@v2
43
39
with :
44
- token : ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN || github.token }}
40
+ token : ${{ github.token }}
45
41
tag_name : ${{ github.event.inputs.version || github.ref_name }}
46
42
draft : false
47
43
prerelease : false
Original file line number Diff line number Diff line change 13
13
secrets :
14
14
OP_SERVICE_ACCOUNT_TOKEN :
15
15
required : false
16
- PERSONAL_ACCESS_TOKEN :
17
- required : false
18
16
outputs :
19
17
python-version :
20
18
description : " The Python version that was set up"
21
19
value : ${{ jobs.setup.outputs.python-version }}
22
- PERSONAL_ACCESS_TOKEN :
23
- description : " The personal access token"
24
- value : ${{ jobs.setup.outputs.PERSONAL_ACCESS_TOKEN }}
25
20
26
21
jobs :
27
22
setup :
28
23
runs-on : ubuntu-latest
29
24
outputs :
30
25
python-version : ${{ steps.setup-python.outputs.python-version }}
31
- PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
32
26
steps :
33
27
- name : Load secret
34
- if : ${{ inputs.install-deps != 'none' }}
35
28
uses : 1password/load-secrets-action@v2
36
29
with :
37
30
export-env : true
43
36
uses : actions/checkout@v4
44
37
with :
45
38
fetch-depth : 0
46
- token : ${{ env.PERSONAL_ACCESS_TOKEN || github.token }}
39
+ token : ${{ github.token }}
47
40
48
41
- name : Setup Python
49
42
id : setup-python
You can’t perform that action at this time.
0 commit comments