Skip to content

Commit fdc616d

Browse files
authored
Set top-level permissions for CodeQL workflow (#2889)
As recommended by https://scorecard.dev/viewer/?uri=github.com/google/gson Note however, that this currently most likely has no effect because the `analyze` job already has permissions set (and `contents: read` might be implicit for public repositories). Nonetheless https://github.com/ossf/scorecard/blob/v5.1.1/docs/checks.md#token-permissions recommends to set reduced top-level permissions so that if an additional job is added in the future and it is missing explicit `permissions` it will inherit the reduced top-level permissions.
1 parent 9334715 commit fdc616d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
# Run every Monday at 16:10
1212
- cron: '10 16 * * 1'
1313

14+
permissions:
15+
contents: read # to fetch code (actions/checkout)
16+
1417
jobs:
1518
analyze:
1619
name: Analyze (${{ matrix.language }})

0 commit comments

Comments
 (0)