Skip to content

Commit 28efb16

Browse files
committed
Add explicit permissions to CI workflow
Declare workflow-level contents: read as the default least-privilege scope, and override per-job to contents: write for the build job because maven-dependency-submission-action posts to the Dependency submission API and that endpoint requires contents: write. This documents the actual scope needed by each part of the workflow rather than inheriting the repository default token permissions, which is the recommended hardening pattern.
1 parent 63b3c1b commit 28efb16

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114

1215
runs-on: ${{ matrix.os }}
1316
strategy:
1417
matrix:
1518
os: [ubuntu-latest, macos-latest, windows-latest]
19+
# `Update dependency graph` step uses maven-dependency-submission-action,
20+
# which posts to the Dependency submission API and requires `contents: write`.
21+
permissions:
22+
contents: write
1623

1724
steps:
1825
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)