Skip to content

Commit 00e4233

Browse files
Restrict permissions for GitHub actions (#2334)
1 parent edc25cb commit 00e4233

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/linter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
on: [push, pull_request]
22
name: linter
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
lint:
9+
permissions:
10+
contents: read # for actions/checkout to fetch code
11+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
612
strategy:
713
matrix:
814
go-version: [1.x]

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ name: tests
1010
env:
1111
GO111MODULE: on
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
18+
permissions:
19+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
20+
contents: read # for actions/checkout to fetch code
1521
strategy:
1622
matrix:
1723
go-version: [1.x, 1.17.x]

0 commit comments

Comments
 (0)