Skip to content

Commit 6e07d2f

Browse files
authored
GitHub Workflows security hardening (#12745)
* build: harden gradle.yml permissions Signed-off-by: Alex <[email protected]> * build: harden retry-release.yml permissions Signed-off-by: Alex <[email protected]> * build: harden release-notes.yml permissions Signed-off-by: Alex <[email protected]> * build: harden release.yml permissions Signed-off-by: Alex <[email protected]> Signed-off-by: Alex <[email protected]>
1 parent a8eec98 commit 6e07d2f

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.github/workflows/gradle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ on:
1111
- '[4-9]+.[0-9]+.x'
1212
- '[3-9]+.[3-9]+.x'
1313
workflow_dispatch:
14+
15+
permissions:
16+
contents: read # to fetch code (actions/checkout)
17+
1418
jobs:
1519
build:
20+
permissions:
21+
contents: read # to fetch code (actions/checkout)
22+
checks: write # to publish result as PR check (scacap/action-surefire-report)
23+
1624
runs-on: ubuntu-latest
1725
strategy:
1826
matrix:

.github/workflows/release-notes.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- '[4-9]+.[0-9]+.x'
99
- '[3-9]+.[3-9]+.x'
1010
workflow_dispatch:
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
1115
jobs:
1216
release_notes:
1317
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: Release
22
on:
33
release:
44
types: [published]
5+
permissions: {}
56
jobs:
67
release:
8+
permissions:
9+
contents: write # to create release
10+
issues: write # to modify milestones
11+
712
runs-on: ubuntu-latest
813
strategy:
914
matrix:

.github/workflows/retry-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ on:
88
target_branch:
99
description: The Target Branch (e.g. 5.0.x)
1010
required: true
11+
permissions: {}
1112
jobs:
1213
release:
14+
permissions:
15+
contents: write # to create release
16+
issues: read # to get closed issues
17+
1318
runs-on: ubuntu-latest
1419
strategy:
1520
matrix:

0 commit comments

Comments
 (0)