Skip to content

Commit c271451

Browse files
authored
Merge pull request #58 from lool/fix-perms-for-included-workflows
Fix permissions for included workflows
2 parents 0bfb652 + bcdc331 commit c271451

File tree

10 files changed

+42
-29
lines changed

10 files changed

+42
-29
lines changed

.github/workflows/build-daily.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ on:
77
# allow manual runs
88
workflow_dispatch:
99

10+
# implicitely set all other permissions to none
1011
permissions:
11-
contents: read
12+
checks: write # test.yml
13+
contents: read # debos.yml test.yml
14+
packages: read # test.yml
15+
pull-requests: write # test.yml
1216

1317
jobs:
1418
build-daily:

.github/workflows/build-on-pr.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Build on PR
33
on:
44
pull_request:
55

6+
# implicitely set all other permissions to none
67
permissions:
7-
checks: write # required by test reporting action
8-
pull-requests: write # required by test reporting action
9-
contents: read # github default
10-
packages: read # github default
8+
checks: write # test.yml
9+
contents: read # debos.yml lava-schema-check.yml test.yml
10+
packages: read # test.yml
11+
pull-requests: write # test.yml
1112

1213
jobs:
1314
event-file:

.github/workflows/build-on-push.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
push:
55
branches: [main]
66

7+
# implicitely set all other permissions to none
78
permissions:
8-
checks: write
9-
pull-requests: write
10-
contents: read
11-
packages: read
9+
checks: write # test.yml
10+
contents: read # debos.yml lava-schema-check.yml test.yml
11+
packages: read # test.yml
12+
pull-requests: write # test.yml
1213

1314
jobs:
1415
build-daily:

.github/workflows/debos.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ on:
77
description: "URL to retrieve build artifacts"
88
value: ${{ jobs.build-debos.outputs.url }}
99

10-
# only need permission to read repository; implicitely set all other
11-
# permissions to none
10+
# implicitely set all other permissions to none
1211
permissions:
13-
contents: read
12+
contents: read # actions/checkout
1413

1514
# cancel in progress builds for this workflow triggered by the same ref
1615
concurrency:

.github/workflows/lava-schema-check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: Chech LAVA templates
1+
name: Check LAVA templates
22

33
on:
44
workflow_call:
55

6+
# implicitely set all other permissions to none
7+
permissions:
8+
contents: read # actions/checkout
9+
610
jobs:
711
schema-check:
812
runs-on: ubuntu-latest

.github/workflows/linux.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ on:
77
# allow manual runs
88
workflow_dispatch:
99

10-
# only need permission to read repository; implicitely set all other
11-
# permissions to none
10+
# implicitely set all other permissions to none
1211
permissions:
13-
contents: read
12+
contents: read # actions/checkout
1413

1514
env:
1615
# where results will be posted/hosted

.github/workflows/static-checks.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ on:
88
push:
99
branches: [main]
1010

11-
# only need permission to read repository; implicitely set all other
12-
# permissions to none
11+
# implicitely set all other permissions to none
1312
permissions:
14-
contents: read
13+
contents: read # actions/checkout
1514

1615
# cancel in progress builds for this workflow triggered by the same ref
1716
concurrency:

.github/workflows/test-pr.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ on:
88
types:
99
- completed
1010

11+
# implicitely set all other permissions to none
1112
permissions:
12-
checks: write # required by test reporting action
13-
pull-requests: write # required by test reporting action
14-
contents: read # github default
15-
packages: read # github default
13+
checks: write # test.yml EnricoMi/publish-unit-test-result-action
14+
contents: read # test.yml actions/checkout
15+
packages: read # test.yml actions/download-artifact
16+
# test.yml EnricoMi/publish-unit-test-result-action
17+
# thollander/actions-comment-pull-request
18+
pull-requests: write
1619

1720
jobs:
1821
retrieve-build-url:

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ on:
77
required: true
88
type: string
99

10+
# implicitely set all other permissions to none
11+
permissions:
12+
checks: write # EnricoMi/publish-unit-test-result-action
13+
contents: read # actions/checkout
14+
packages: read # actions/download-artifact
15+
pull-requests: write # EnricoMi/publish-unit-test-result-action
16+
1017
jobs:
1118
prepare-job-list:
1219
runs-on: ubuntu-latest
@@ -74,9 +81,6 @@ jobs:
7481
name: "Publish Tests Results"
7582
needs: submit-job
7683
runs-on: ubuntu-latest
77-
permissions:
78-
checks: write
79-
pull-requests: write
8084

8185
steps:
8286
- name: Download Artifacts

.github/workflows/u-boot.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ on:
77
# allow manual runs
88
workflow_dispatch:
99

10-
# only need permission to read repository; implicitely set all other
11-
# permissions to none
10+
# implicitely set all other permissions to none
1211
permissions:
13-
contents: read
12+
contents: read # actions/checkout
1413

1514
env:
1615
# where results will be posted/hosted

0 commit comments

Comments
 (0)