Skip to content

ci(sonarqube): pin the CI reusables to the scan without PR analysis - #343

Merged
BryanFRD merged 1 commit into
mainfrom
ci/sonar-pin-after-340
Sep 18, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
ci/sonar-pin-after-340

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Follow-up to #340 (refs #329), from its review.

reusable-ci-{rust,node,astro,go} still called reusable-sonarqube-scan at 2883414, the version that analysed pull requests and declared pull-requests: write. That forced them to keep granting pull-requests: write to a job that no longer runs on a pull request, and nothing in the files said why, so the next cleanup would have dropped it and broken every caller at startup.

This moves the four pins to efe7f97 (#340's merge commit), whose scan declares contents: read only, and drops the now-unneeded grant. The constraint the review flagged is gone rather than documented.

@BryanFRD
BryanFRD enabled auto-merge (squash) September 18, 2026 08:09

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the pin target: reusable-sonarqube-scan.yml at efe7f97 declares permissions: contents: read and gates the job on github.event_name != 'pull_request', so dropping pull-requests: write in the four callers cannot fail the call at startup. Every input each caller passes (runner, working-directory, project-key, coverage-artifact, args) and the SONAR_TOKEN secret still exist at that SHA. Two nits inline on leftover packages: read.

Comment on lines 212 to 213
contents: read
packages: read

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: packages: read is surplus here for the same reason pull-requests: write was. The scan at efe7f97 only checks out, downloads artifacts and runs sonar-scanner; nothing reads GitHub Packages, and the callee declares contents: read alone.

Suggested change
contents: read
packages: read
contents: read

Comment on lines 292 to 293
contents: read
packages: read

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: same as in the Astro reusable, packages: read is unused by the scan job (the install happens in test, not in the called workflow).

Suggested change
contents: read
packages: read
contents: read

@BryanFRD
BryanFRD merged commit 1d44811 into main Sep 18, 2026
12 checks passed
@BryanFRD
BryanFRD deleted the ci/sonar-pin-after-340 branch September 18, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant