Skip to content

Commit c3020e2

Browse files
authored
GitHub Workflows security hardening (#3519)
* build: harden tutorials.yml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> * build: harden contrib.yml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> * build: harden tests.yml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com>
1 parent 5d436ba commit c3020e2

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/workflows/contrib.yml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ concurrency:
2222
group: contrib-${{ github.ref }}
2323
cancel-in-progress: true
2424

25+
permissions:
26+
contents: read # to fetch code (actions/checkout)
27+
2528
jobs:
2629
stable:
2730
# Check each OS, all supported Python, minimum versions and latest releases

.github/workflows/tests.yml

+7
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ concurrency:
2929
group: tests-${{ github.ref }}
3030
cancel-in-progress: true
3131

32+
permissions: {}
3233
jobs:
3334
build:
35+
permissions:
36+
contents: read # to fetch code (actions/checkout)
37+
3438
runs-on: ubuntu-latest
3539
steps:
3640
- uses: actions/checkout@v3
@@ -80,6 +84,9 @@ jobs:
8084

8185
stable:
8286
# Check each OS, all supported Python, minimum versions and latest releases
87+
permissions:
88+
contents: read # to fetch code (actions/checkout)
89+
8390
runs-on: ${{ matrix.os }}
8491
strategy:
8592
matrix:

.github/workflows/tutorials.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency:
99
group: tutorials-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
permissions: {}
1213
jobs:
1314
tutorial:
1415
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)