Skip to content

Commit d72ffb4

Browse files
authored
ci: set minimal permissions to github workflows (#4665)
* set ci.yml minimal permissions Signed-off-by: Joyce <[email protected]> * set configure.yml minimal permissions Signed-off-by: Joyce <[email protected]> * set format.yml minimal permissions Signed-off-by: Joyce <[email protected]> * set pip.yml minimal permissions Signed-off-by: Joyce <[email protected]> * set upstream.yml minimal permissions Signed-off-by: Joyce <[email protected]> * set labeler.yml minimal permissions Signed-off-by: Joyce <[email protected]> * Update ci.yml to read all Signed-off-by: Joyce <[email protected]> * test labeler.yml Signed-off-by: Joyce <[email protected]> * restore the if at labeler.yml Signed-off-by: Joyce <[email protected]> --------- Signed-off-by: Joyce <[email protected]>
1 parent cca4c51 commit d72ffb4

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- stable
1010
- v*
1111

12+
permissions: read-all
13+
1214
concurrency:
1315
group: test-${{ github.ref }}
1416
cancel-in-progress: true

.github/workflows/configure.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- stable
1010
- v*
1111

12+
permissions:
13+
contents: read
14+
1215
env:
1316
# For cmake:
1417
VERBOSE: 1

.github/workflows/format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- stable
1313
- "v*"
1414

15+
permissions:
16+
contents: read
17+
1518
env:
1619
FORCE_COLOR: 3
1720
# For cmake:

.github/workflows/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ on:
33
pull_request_target:
44
types: [closed]
55

6+
permissions: {}
7+
68
jobs:
79
label:
810
name: Labeler
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pull-requests: write
1015
steps:
1116

1217
- uses: actions/labeler@main

.github/workflows/pip.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
types:
1313
- published
1414

15+
permissions:
16+
contents: read
17+
1518
env:
1619
PIP_ONLY_BINARY: numpy
1720

.github/workflows/upstream.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
workflow_dispatch:
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: upstream-${{ github.ref }}
1013
cancel-in-progress: true

0 commit comments

Comments
 (0)