Skip to content

Commit d8495cf

Browse files
authored
build: Add explicit least-privilege permissions to CI workflow (#185)
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. Signed-off-by: Arpit Jain <arpitjain099@gmail.com> * Drop dependency-graph step, simplify perms to contents: read Per @jdneo's review: the 'Update dependency graph' step (maven-dependency -submission-action) has been failing in CI; removing it lets the workflow hold to the strict workflow-level contents: read default with no per-job write override needed. Net change vs main: - workflow-level permissions: contents: read (new) - Update dependency graph step: removed - per-job permissions: contents: write override on build: not added Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
1 parent 3f0a5d4 commit d8495cf

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

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

@@ -38,8 +41,3 @@ jobs:
3841
with:
3942
run: >-
4043
./mvnw clean verify --batch-mode
41-
42-
# Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
43-
- name: Update dependency graph
44-
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
45-
continue-on-error: true

0 commit comments

Comments
 (0)