Skip to content

Commit 65c4756

Browse files
authored
Merge pull request #2728 from thaJeztah/gha_permissions
gha: set default permissions to "contents: read"
2 parents d3ff70a + b1a13bb commit 65c4756

File tree

7 files changed

+68
-5
lines changed

7 files changed

+68
-5
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: build
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
concurrency:
413
group: ${{ github.workflow }}-${{ github.ref }}
514
cancel-in-progress: true

.github/workflows/codeql.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
name: codeql
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
on:
413
push:
514
branches:
615
- 'master'
716
- 'v[0-9]*'
817
pull_request:
918

10-
permissions:
11-
actions: read
12-
contents: read
13-
security-events: write
14-
1519
env:
1620
GO_VERSION: "1.22"
1721

1822
jobs:
1923
codeql:
24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
2029
runs-on: ubuntu-24.04
2130
steps:
2231
-

.github/workflows/docs-release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: docs-release
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
on:
413
workflow_dispatch:
514
inputs:

.github/workflows/docs-upstream.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
# https://github.com/docker/docker.github.io/blob/98c7c9535063ae4cd2cd0a31478a21d16d2f07a3/docker-bake.hcl#L34-L36
44
name: docs-upstream
55

6+
# Default to 'contents: read', which grants actions to read commits.
7+
#
8+
# If any permission is set, any permission not included in the list is
9+
# implicitly set to "none".
10+
#
11+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
12+
permissions:
13+
contents: read
14+
615
concurrency:
716
group: ${{ github.workflow }}-${{ github.ref }}
817
cancel-in-progress: true

.github/workflows/e2e.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: e2e
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
concurrency:
413
group: ${{ github.workflow }}-${{ github.ref }}
514
cancel-in-progress: true

.github/workflows/labeler.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: labeler
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
concurrency:
413
group: ${{ github.workflow }}-${{ github.ref }}
514
cancel-in-progress: true

.github/workflows/validate.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: validate
22

3+
# Default to 'contents: read', which grants actions to read commits.
4+
#
5+
# If any permission is set, any permission not included in the list is
6+
# implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
11+
312
concurrency:
413
group: ${{ github.workflow }}-${{ github.ref }}
514
cancel-in-progress: true

0 commit comments

Comments
 (0)