chore: Set permissions for GitHub actions (#8550)

Restrict the GitHub token permissions only to just what is required and make them read-only where possible.

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
This commit is contained in:
neilnaveen 2022-07-04 14:12:32 -05:00 committed by GitHub
parent 8494f7515d
commit f135bfa3e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 0 deletions

View File

@ -8,8 +8,13 @@ on:
env:
CI: true
permissions:
contents: read
jobs:
build_cli:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
runs-on: macos-11
steps:
- uses: actions/checkout@v2

View File

@ -6,6 +6,9 @@ on:
pull_request:
branches: [master]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest

View File

@ -9,6 +9,9 @@ on:
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest

View File

@ -4,6 +4,9 @@ on:
push:
branches: [master]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest

View File

@ -4,6 +4,9 @@ on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest