Skip to content

ci: run Sonar on fork PRs via pull_request_target - #3500

Closed
csviri wants to merge 1 commit into
mainfrom
sonar-fixxx
Closed

ci: run Sonar on fork PRs via pull_request_target#3500
csviri wants to merge 1 commit into
mainfrom
sonar-fixxx

Conversation

@csviri

@csviri csviri commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Sonar never ran on PRs: the job was gated on
head.repo.owner.login == 'operator-framework', which is false for
fork PRs (all contributions), and plain pull_request from forks
doesn't expose SONAR_TOKEN anyway.

Switch to pull_request_target so the job runs in the base-repo
context with secrets, check out the PR head so we analyze the
proposed change, pass explicit sonar.pullrequest.* properties
(auto-detection reflects the base branch under pull_request_target),
and key concurrency by PR number so PRs don't cancel each other.

Sonar never ran on PRs: the job was gated on
head.repo.owner.login == 'operator-framework', which is false for
fork PRs (all contributions), and plain pull_request from forks
doesn't expose SONAR_TOKEN anyway.

Switch to pull_request_target so the job runs in the base-repo
context with secrets, check out the PR head so we analyze the
proposed change, pass explicit sonar.pullrequest.* properties
(auto-detection reflects the base branch under pull_request_target),
and key concurrency by PR number so PRs don't cancel each other.
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2026
Comment thread .github/workflows/sonar.yml Outdated
Comment on lines 67 to 73
@csviri csviri closed this Jul 16, 2026
@csviri
csviri deleted the sonar-fixxx branch August 3, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants