Skip to content

Commit df49cb2

Browse files
[StepSecurity] ci: Harden GitHub Actions (#201)
1 parent 36850d1 commit df49cb2

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ on:
1919
schedule:
2020
- cron: '34 18 * * 6'
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
analyze:
2427
name: Analyze (C/C++)
2528
runs-on: windows-latest
2629
timeout-minutes: 360
2730
permissions:
28-
security-events: write
31+
actions: read # for github/codeql-action/init to get workflow details
32+
contents: read # for actions/checkout to fetch code
33+
security-events: write # for github/codeql-action/autobuild to send a status report
2934
packages: read
3035

3136
steps:

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
- build/*.ps1
1818
- build/*.yml
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
build:
2225
runs-on: ${{ matrix.os }}

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
- build/*.ps1
1818
- build/*.yml
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
build:
2225
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)