Skip to content

Commit 6d7dc53

Browse files
committed
Refine the permission jobs in sphinx workflow
1 parent e7b42f7 commit 6d7dc53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/sphinx.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ concurrency:
6060
group: ${{ github.workflow }}-${{ github.ref }}
6161
cancel-in-progress: true
6262

63+
permissions: {}
64+
6365
jobs:
6466
sphinx-changes:
6567
runs-on: ubuntu-latest
@@ -113,6 +115,8 @@ jobs:
113115
runs-on: ubuntu-latest
114116
needs: [sphinx-version]
115117
if: ${{ (contains(fromJSON('["push", "release"]'), github.event_name)) || (needs.sphinx-changes.outputs.changes == 'true') }}
118+
permissions:
119+
contents: read
116120
steps:
117121
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
118122
with:
@@ -136,9 +140,12 @@ jobs:
136140
if: ${{ (contains(fromJSON('["push", "release"]'), github.event_name)) }}
137141
runs-on: ubuntu-latest
138142
needs: [sphinx-version, sphinx-build]
143+
permissions:
144+
contents: read
139145
steps:
140146
- name: Checkout code
141147
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148+
sparse-checkout: .github
142149

143150
- name: Download HTML artifacts
144151
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
@@ -158,8 +165,11 @@ jobs:
158165
if: ${{ github.event_name == 'release' }}
159166
runs-on: ubuntu-latest
160167
needs: [sphinx-version, sphinx-build, sphinx-deploy-html]
168+
permissions:
169+
contents: read
161170
steps:
162171
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
172+
sparse-checkout: .github
163173
- shell: python
164174
run: |
165175
import os

0 commit comments

Comments
 (0)