Skip to content

Commit de8b080

Browse files
committed
Remove over-provisioned actions scope from GITHUB_TOKEN permissions
The `actions: write` (and `actions: read` in scorecard) permissions added in quickwit-oss#5946 are unnecessary: actions/cache and actions/upload-artifact authenticate via ACTIONS_RUNTIME_TOKEN, not GITHUB_TOKEN, and actions/download-artifact only uses GITHUB_TOKEN when its github-token input is explicitly set. Where removing `actions: write` left only `contents: read` (matching the workflow-level default), the redundant job-level permissions block is removed entirely. For the tests and lints jobs in ci.yml, `actions: write` is replaced with `pull-requests: read` which dorny/paths-filter actually needs to read PR file lists.
1 parent 1e48533 commit de8b080

File tree

7 files changed

+2
-22
lines changed

7 files changed

+2
-22
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
timeout-minutes: 60
3535
permissions:
3636
contents: read
37-
actions: write
37+
pull-requests: read
3838
services:
3939
# PostgreSQL service container
4040
postgres:
@@ -120,7 +120,7 @@ jobs:
120120
timeout-minutes: 60
121121
permissions:
122122
contents: read
123-
actions: write
123+
pull-requests: read
124124
steps:
125125
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
126126
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@@ -192,9 +192,6 @@ jobs:
192192
thirdparty-license:
193193
name: Check Datadog third-party license file
194194
runs-on: ubuntu-latest
195-
permissions:
196-
contents: read
197-
actions: write
198195
steps:
199196
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
200197
- name: Install Rust toolchain

.github/workflows/coverage.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ jobs:
3131
name: Coverage
3232
runs-on: gh-ubuntu-arm64
3333
timeout-minutes: 40
34-
permissions:
35-
contents: read
36-
actions: write
3734
# Setting a containing will require to fix the QW_S3_ENDPOINT to http://localstack:4566
3835
services:
3936
localstack:

.github/workflows/publish_docker_images.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ jobs:
3131
platform: linux/arm64
3232
platform_suffix: arm64
3333
runs-on: ${{ matrix.os }}
34-
permissions:
35-
contents: read
36-
actions: write
3734
environment:
3835
name: production
3936
steps:
@@ -119,9 +116,6 @@ jobs:
119116
merge:
120117
runs-on: ubuntu-latest
121118
needs: [docker]
122-
permissions:
123-
contents: read
124-
actions: read
125119
environment: production
126120
steps:
127121
- name: Download digests

.github/workflows/publish_nightly_packages.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
runs-on: macos-latest
1515
permissions:
1616
contents: write
17-
actions: write
1817
strategy:
1918
fail-fast: false
2019
matrix:
@@ -35,7 +34,6 @@ jobs:
3534
runs-on: ubuntu-latest
3635
permissions:
3736
contents: write
38-
actions: write
3937
steps:
4038
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4139
- uses: ./.github/actions/cross-build-binary

.github/workflows/publish_release_packages.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
runs-on: macos-latest
1515
permissions:
1616
contents: write
17-
actions: write
1817
strategy:
1918
matrix:
2019
target: [x86_64-apple-darwin, aarch64-apple-darwin]
@@ -37,7 +36,6 @@ jobs:
3736
runs-on: ubuntu-latest
3837
permissions:
3938
contents: write
40-
actions: write
4139
steps:
4240
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4341
- name: Extract asset version

.github/workflows/scorecard.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
security-events: write
1919
# Needed to publish results
2020
id-token: write
21-
actions: read
2221
contents: read
2322

2423
steps:

.github/workflows/ui-ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ jobs:
2121
tests:
2222
name: ${{ matrix.task.name }}
2323
runs-on: ubuntu-latest
24-
permissions:
25-
contents: read
26-
actions: write
2724
strategy:
2825
fail-fast: false
2926
matrix:

0 commit comments

Comments
 (0)