Skip to content

Commit

Permalink
ci: add minimum GitHub token permissions for workflows (#1792)
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Sharma <varunsh@stepsecurity.io>
  • Loading branch information
varunsh-coder committed Oct 3, 2022
1 parent 93d1913 commit 23fc5e0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/labeler.yml
Expand Up @@ -2,8 +2,14 @@ name: "Pull Request Labeler"
on:
- pull_request_target

permissions:
contents: read

jobs:
triage:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/size-labeler.yml
Expand Up @@ -4,8 +4,13 @@ name: size-labeler

on: [pull_request_target]

permissions:
contents: read

jobs:
size-labeler:
permissions:
pull-requests: write # for codelytv/pr-size-labeler to add labels & comment on PRs
runs-on: ubuntu-latest
name: Label the PR size
steps:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/stale.yml
Expand Up @@ -4,9 +4,15 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
stale:

permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -8,6 +8,9 @@ on:
env:
GO111MODULE: on

permissions:
contents: read

jobs:


Expand All @@ -30,6 +33,9 @@ jobs:
golangci-lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-latest
steps:

Expand Down

0 comments on commit 23fc5e0

Please sign in to comment.