Skip to content

Commit 426184f

Browse files
ptzieglerazoitl
authored andcommitted
Explicitly set workflow permissions
If a GitHub Actions job or workflow has no explicit permissions set, then the repository permissions are used. Repositories created under organizations inherit the organization permissions. Often these permissions do not adhere to the principle of least privilege and can be reduced to read-only, leaving the write permission only to a specific types as issues: write or pull-requests: write.
1 parent 5bc09e8 commit 426184f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
pull_request:
66

7+
permissions: {}
8+
79
jobs:
810
build:
911
strategy:

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ on:
66
types:
77
- completed
88

9+
permissions: {}
10+
911
jobs:
1012
unit-test-results:
1113
name: Unit Test Results
1214
runs-on: ubuntu-latest
1315
if: github.event.workflow_run.conclusion != 'skipped'
14-
16+
permissions:
17+
checks: write
18+
pull-requests: write
19+
contents: read
20+
issues: read
21+
actions: read
1522
steps:
1623
- name: Download and Extract Artifacts
1724
env:

0 commit comments

Comments
 (0)