Skip to content

Commit

Permalink
chore: Set permissions for GitHub actions (#4732)
Browse files Browse the repository at this point in the history
  • Loading branch information
naveensrinivasan committed Apr 24, 2022
1 parent 92ab17d commit b8bc050
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codecoverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- '**'

permissions:
contents: read

jobs:
publish-code-coverage:
if: ${{ !contains(github.event.head_commit.message, 'coverage skip') }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
gradle:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build-detekt-docs:
if: github.repository == 'detekt/detekt'
Expand Down Expand Up @@ -43,6 +46,8 @@ jobs:
path: docs/pages/gettingstarted/cli-options.md

build-website:
permissions:
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
needs: build-detekt-docs
runs-on: ubuntu-latest
container: jekyll/builder
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/detekt-with-type-resolution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ on:
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

permissions:
contents: read

jobs:
plain:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/fossascan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
fossa-scan:
if: ${{ github.repository == 'detekt/detekt' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- '**'

permissions:
contents: read

jobs:
validation:
name: Validation
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

permissions:
contents: read

jobs:
gradle:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
Expand Down

0 comments on commit b8bc050

Please sign in to comment.