Skip to content

Commit e059045

Browse files
authored
Update python-package.yml
1 parent 9f037a8 commit e059045

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/python-package.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ on:
2222
type: boolean
2323
default: false
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629
extract_version:
2730
runs-on: ubuntu-latest
2831
outputs:
2932
version: ${{ steps.get_version.outputs.VERSION }}
33+
permissions:
34+
contents: read
3035
steps:
3136
- uses: actions/checkout@v4
3237
- name: Set up Python
@@ -61,6 +66,8 @@ jobs:
6166
build_wheels:
6267
name: Build wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
6368
runs-on: ${{ matrix.buildplat[0] }}
69+
permissions:
70+
contents: read
6471
if: github.event.inputs.build_type == 'all' || github.event.inputs.build_type == 'wheels'
6572
strategy:
6673
fail-fast: false
@@ -117,6 +124,8 @@ jobs:
117124
build_sdist:
118125
name: Build sdist
119126
runs-on: ubuntu-latest
127+
permissions:
128+
contents: read
120129
if: github.event.inputs.build_type == 'all' || github.event.inputs.build_type == 'sdist'
121130

122131
steps:
@@ -143,6 +152,8 @@ jobs:
143152
upload_pypi:
144153
needs: [build_wheels, build_sdist]
145154
runs-on: ubuntu-latest
155+
permissions:
156+
id-token: write
146157
if: github.event.inputs.upload_to_pypi == 'true'
147158
steps:
148159
- uses: actions/download-artifact@v3
@@ -162,6 +173,8 @@ jobs:
162173
create_release:
163174
needs: [extract_version, build_wheels, build_sdist, upload_pypi]
164175
runs-on: ubuntu-latest
176+
permissions:
177+
contents: write
165178
if: github.event.inputs.create_release == 'true'
166179
steps:
167180
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)