Repository navigation
fix(ci): scope workflow write permissions to job level and enforce SonarCloud quality gate wait - #39
Conversation
…narCloud quality gate wait
There was a problem hiding this comment.
🟡 Changes recommended
The build job in javadoc-pages.yml now runs actions/configure-pages with no pages permission, which will fail the "Configure GitHub Pages" step and break the Pages build.
1 open finding
What changed in this PR
This PR hardens three GitHub Actions workflows in response to SonarCloud findings. It applies least-privilege permissions by keeping workflow-level permissions at contents: read and scoping write permissions to the specific jobs that need them (addressing githubactions:S8233), prefixes shell glob paths with ./ to avoid option-injection (addressing githubactions:S6573), and makes the SonarCloud step fail fast when the Quality Gate fails.
Changes:
release.yml: workflow-levelcontents: read;contents: write+packages: writemoved to thereleasejob; glob paths prefixed with./.javadoc-pages.yml:pages: write+id-token: writemoved from workflow level to thedeployjob; Javadoc jar glob prefixed with./.sonar.yml: added workflow-levelpermissions: contents: readand-Dsonar.qualitygate.wait=trueto block on Quality Gate failures.
| File | Description |
|---|---|
.github/workflows/sonar.yml |
Adds read-only workflow permissions and enforces Quality Gate wait so the status check reflects gate failures. |
.github/workflows/release.yml |
Restricts workflow permissions to read and grants write only to the release job; adds ./ glob prefixes. |
.github/workflows/javadoc-pages.yml |
Moves Pages/OIDC write permissions to the deploy job and ./-prefixes the Javadoc jar glob, but leaves the build job without any pages permission. |
Note: This repository is configured with the MCSWE v3 gate-driven SDLC protocol. These changes are CI/infrastructure-only (
.github/workflows) and do not introduce application source or test files, so the per-functionTRACEABILITY_MAPPING/SRS requirements do not apply here.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| permissions: | ||
| contents: read |

Summary
githubactions:S8233vulnerabilities in.github/workflows/javadoc-pages.ymland.github/workflows/release.ymlby scopingpages: write,id-token: write,contents: write, andpackages: writeto the job level while keeping workflow-level permissions atcontents: read.githubactions:S6573inrelease.ymlandjavadoc-pages.ymlby prefixing glob paths with./.-Dsonar.qualitygate.wait=trueandpermissions: contents: readto.github/workflows/sonar.ymlso theSonarCloud Scanstatus check fails immediately if the SonarCloud Quality Gate fails.