Skip to content

Commit

Permalink
build: add permissions to current github action workflows
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
clydin authored and alan-agius4 committed Feb 16, 2022
1 parent c0736ea commit edc92d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/dev-infra.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: DevInfra

# Declare default permissions as read only.
permissions:
contents: read

on:
pull_request_target:
types: [opened, synchronize, reopened]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/feature-requests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Feature request triage bot

# Declare default permissions as read only.
permissions:
contents: read

on:
schedule:
# Run at 13:00 every day
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lock-closed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Lock Inactive Issues

# Declare default permissions as read only.
permissions:
contents: read

on:
schedule:
# Run at 08:00 every day
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
workflow_dispatch:

# Declare default permissions as read only.
permissions: read-all
permissions:
contents: read

jobs:
analysis:
Expand Down

0 comments on commit edc92d1

Please sign in to comment.