Skip to content

Commit 3d9660d

Browse files
committed
Fix No Toplevel Permission Defined
1 parent f33bfae commit 3d9660d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
schedule:
1515
- cron: '0 1 * * *'
1616
merge_group:
17+
permissions: read-all
1718

1819
concurrency:
1920
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
@@ -22,6 +23,9 @@ concurrency:
2223
jobs:
2324
build:
2425
runs-on: ubuntu-24.04
26+
permissions:
27+
actions: write # Upload artifacts
28+
security-events: write # Upload CodeQL results
2529
steps:
2630
- name: Check out Git repository
2731
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -79,7 +83,8 @@ jobs:
7983
image-scan:
8084
needs: build
8185
runs-on: ubuntu-24.04
82-
86+
permissions:
87+
security-events: write # Upload Trivy SARIF results
8388
steps:
8489
- name: Download Torch Image
8590
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
@@ -270,8 +275,8 @@ jobs:
270275
- env-var-check
271276
runs-on: ubuntu-24.04
272277
permissions:
273-
packages: write
274-
id-token: write
278+
packages: write # Push to GitHub Container Registry
279+
id-token: write # For Cosign signing
275280
if: ${{ ! startsWith(github.head_ref, 'dependabot/')}}
276281

277282
steps:

0 commit comments

Comments
 (0)