question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

circleci sonarQube scan currently fails for forked PR builds

See original GitHub issue

Describe the bug

PRs from forks will fail with [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project server: Parameter 'sonar.pullrequest.branch' is mandatory for a pull request analysis.

Needs to be fixed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
johanneseschrigcommented, May 22, 2020

Hi Jonas! Unfortunately we currently just work around it with https://github.com/corona-warn-app/cwa-server/pull/236. This way we don’t block any PRs, but sonar still doesn’t run on community PRs atm.

0reactions
CCFennercommented, May 27, 2020

A workaround for this could be a chat-ops-like workflow. The following would be needed:

  • a workflow that listens to issue comments
    • if specific comment (e.g. /sonar) is posted on a fork pr push the changes from the fork to a dedicated branch on the upstream repository
  • a workflow that runs sonar on push to the dedicated branch

This would require a PAT of a personal or technical user in repository secrets with repo write permissions as the default secrets.GITHUB_TOKEN is not sufficient.

Would this be a way to go?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting pull requests from fork of private repository ...
Pull requests from forks of your private repository are failing at the checkout step with an error message as shown below.
Read more >
Error: Parameter 'sonar.pullrequest.branch' is mandatory for a ...
I created a basic test project on SonarCloud with Circle CI. Following the tutorial on the documentation, it worked perfectly, both on scanning...
Read more >
Merge request pipelines - GitLab Docs
The merge request pipeline fails. When using the merge when pipeline succeeds feature and both pipelines types are present, the merge request pipelines...
Read more >
Not authorized to execute any SonarQube analysis when ...
First, I raise your attention on one important point: you should not run a "standard" SonarQube analysis on PR - otherwise your project...
Read more >
Add specific pipelines configuration for Pull Request events
Currently no pipeline is being triggered which would allow automated comments on the pull request (SonarQube or any other smart tool/ bot). If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found