Skip to content

Commit 6cb8e63

Browse files
authored
Merge pull request #1483 from github/brianaj/external-pr-1471
External PR 1471: Add explicit permissions to CI workflow
2 parents a81428f + b074991 commit 6cb8e63

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ on:
1111
- cron: "0 7 * * *"
1212
workflow_dispatch:
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
build:
19+
permissions:
20+
contents: read
21+
actions: write
22+
security-events: write
1623
strategy:
1724
fail-fast: false
1825
matrix:
@@ -85,6 +92,9 @@ jobs:
8592
if: matrix.runner-os == 'ubuntu-latest'
8693

8794
upload-event-file:
95+
permissions:
96+
contents: read
97+
actions: write
8898
runs-on: ubuntu-latest
8999
steps:
90100
# This is used by the subsequent publish-test-results.yaml
@@ -95,6 +105,9 @@ jobs:
95105
path: ${{ github.event_path }}
96106

97107
build-for-e2e-test:
108+
permissions:
109+
contents: read
110+
actions: write
98111
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'github'
99112
strategy:
100113
fail-fast: false
@@ -140,11 +153,12 @@ jobs:
140153
dist/win-x64/gei-windows-amd64.exe
141154
142155
e2e-test:
143-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'github'
144-
needs: [build-for-e2e-test]
145156
permissions:
146-
checks: write
147157
contents: read
158+
actions: write
159+
checks: write
160+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'github'
161+
needs: [build-for-e2e-test]
148162
strategy:
149163
fail-fast: false
150164
matrix:
@@ -279,6 +293,8 @@ jobs:
279293
shell: pwsh
280294

281295
publish:
296+
permissions:
297+
contents: write
282298
runs-on: ubuntu-latest
283299
if: startsWith(github.ref, 'refs/tags/v')
284300
needs: [build, e2e-test]

0 commit comments

Comments
 (0)