Skip to content

Commit

Permalink
build: harden GitHub workflow permissions
Browse files Browse the repository at this point in the history
Grant pull-requests write permission to the labeler workflow and
read-only to everything else.

Signed-off-by: Alex Low <[email protected]>
[ wrap to 80 columns and fix wrong author as requested by author itself ]
Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
sashashura authored and Ansuel committed Sep 19, 2022
1 parent 412fcf3 commit 7152599
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/formal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Test Formalities
on:
pull_request:

permissions:
contents: read

jobs:
build:
name: Test Formalities
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'include/kernel-*'
- 'package/kernel/**'
- 'target/linux/generic/**'

permissions:
contents: read

jobs:
determine_targets:
name: Set targets
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ name: 'Pull Request Labeler'
on:
- pull_request_target

permissions:
contents: read

jobs:
labeler:
permissions:
contents: read # to determine modified files (actions/labeler)
pull-requests: write # to add labels to PRs (actions/labeler)

name: Pull Request Labeler
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- 'tools/**'
- '.github/workflows/tools.yml'

permissions:
contents: read

jobs:
build:
name: tools-${{ matrix.os }}
Expand Down

0 comments on commit 7152599

Please sign in to comment.