Skip to content

Commit 6cdf285

Browse files
ci: Limit GitHub token permissions for workflows.
This limits the ability for an Action to do mischief with this token. Fixes #22786. Signed-off-by: Varun Sharma <[email protected]>
1 parent f03eed5 commit 6cdf285

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ concurrency:
1212
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}"
1313
cancel-in-progress: true
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
CodeQL:
20+
permissions:
21+
actions: read # for github/codeql-action/init to get workflow details
22+
contents: read # for actions/checkout to fetch code
23+
security-events: write # for github/codeql-action/analyze to upload SARIF results
1724
if: ${{!github.event.repository.private}}
1825
runs-on: ubuntu-latest
1926

.github/workflows/production-suite.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ defaults:
3333
run:
3434
shell: bash
3535

36+
permissions:
37+
contents: read
38+
3639
jobs:
3740
production_build:
3841
# This job builds a release tarball from the current commit, which

.github/workflows/update-oneclick-apps.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Update one click apps
22
on:
33
release:
44
types: [published]
5+
permissions:
6+
contents: read
7+
58
jobs:
69
update-digitalocean-oneclick-app:
710
runs-on: ubuntu-latest

.github/workflows/zulip-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ defaults:
1919
run:
2020
shell: bash
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
tests:
2427
strategy:

0 commit comments

Comments
 (0)