Skip to content

Commit 3dc7ec1

Browse files
[StepSecurity] ci: Harden GitHub Actions (#507)
1 parent 79b4ef0 commit 3dc7ec1

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

.github/workflows/codeql.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ on:
2323
schedule:
2424
- cron: '43 3 * * 3'
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
analyze:
2831
name: Analyze (C/C++)
2932
runs-on: windows-latest
3033
timeout-minutes: 360
3134
permissions:
32-
security-events: write
35+
actions: read # for github/codeql-action/init to get workflow details
36+
contents: read # for actions/checkout to fetch code
37+
security-events: write # for github/codeql-action/autobuild to send a status report
3338
packages: read
3439

3540
steps:

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
- build/*.targets
2222
- build/*.yml
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
build:
2629
runs-on: ${{ matrix.os }}

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
env:
2525
DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
build:
2932
runs-on: ${{ matrix.os }}

.github/workflows/vcpkg.yml

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- LICENSE
1616
- build/*
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
build:
2023
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)