Skip to content

Commit c3afa51

Browse files
committed
CI: Restrict default permissions
Reduces risk of arbitrary code is run by attacker.
1 parent f9371ce commit c3afa51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/main.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: CI
2-
permissions:
3-
contents: write
4-
52
on: [push, pull_request]
63

74
jobs:
85
pre-commit:
6+
permissions:
7+
contents: read
8+
99
runs-on: ubuntu-20.04
1010
steps:
1111
- uses: actions/checkout@v2
@@ -15,6 +15,9 @@ jobs:
1515
- uses: pre-commit/action@0764670bf370aab253130d534e1eda7ff497dc60 # v2.0.0
1616
build:
1717
runs-on: ubuntu-20.04
18+
permissions:
19+
contents: write
20+
1821
steps:
1922
- uses: actions/checkout@v2
2023
with:

0 commit comments

Comments
 (0)