Skip to content

Commit

Permalink
Restrict permissions for GitHub actions (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
naveensrinivasan committed Apr 14, 2022
1 parent edc25cb commit 00e4233
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/linter.yml
@@ -1,8 +1,14 @@
on: [push, pull_request]
name: linter

permissions:
contents: read

jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
strategy:
matrix:
go-version: [1.x]
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -10,8 +10,14 @@ name: tests
env:
GO111MODULE: on

permissions:
contents: read

jobs:
test:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: read # for actions/checkout to fetch code
strategy:
matrix:
go-version: [1.x, 1.17.x]
Expand Down

0 comments on commit 00e4233

Please sign in to comment.