Skip to content

Commit edc92d1

Browse files
clydinalan-agius4
authored andcommitted
build: add permissions to current github action workflows
The currently recommended best practice for Github action workflows is to set top-level permissions to read only. And if the job uses the automatic `GITHUB_TOKEN`, fine-grained permissions for each job based on the job's requirements should also be added. All existing workflows in the repository now have top-level read only permission blocks. Only the `scorecard` workflow currently requires additional job level permissions and the minimum set of permissions were already present for the job. (cherry picked from commit b8c8cc4)
1 parent c0736ea commit edc92d1

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.github/workflows/dev-infra.yml

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

3+
# Declare default permissions as read only.
4+
permissions:
5+
contents: read
6+
37
on:
48
pull_request_target:
59
types: [opened, synchronize, reopened]

.github/workflows/feature-requests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Feature request triage bot
22

3+
# Declare default permissions as read only.
4+
permissions:
5+
contents: read
6+
37
on:
48
schedule:
59
# Run at 13:00 every day

.github/workflows/lock-closed.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Lock Inactive Issues
22

3+
# Declare default permissions as read only.
4+
permissions:
5+
contents: read
6+
37
on:
48
schedule:
59
# Run at 08:00 every day

.github/workflows/scorecard.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
workflow_dispatch:
99

1010
# Declare default permissions as read only.
11-
permissions: read-all
11+
permissions:
12+
contents: read
1213

1314
jobs:
1415
analysis:

0 commit comments

Comments
 (0)