Get GitHub Summary comment via Web API?

  • ALM used: GitHub
  • CI system used: GitHub Actions
  • Scanner command used: mvn sonar:sonar
  • Languages of the repository: Java

Hi, I’m trying to figure out a way to get analysis results for external pull requests without running into the risk of being pwned. This is an open feature request, albeit without an ETA.

To work around this, I’m planning to

  1. run the build in the read-only environment,
  2. save the artifacts,
  3. download artifacts & run mvn sonar:sonar from the privilieged env to analyze.

This should work fine from what I have read, and indeed I’ve tested this locally already and it runs fine.

Now I’d like to retrieve some form of report via the WebAPI to show in the external PR comment, similar to sonar.pullrequest.github.summary_comment. Is there a way to retrieve this through the WebAPI?

Hello Stephan! And welcome to the community!

Currently there is now way to retrieve specifically the PR comment.
But given the project and branch you analyzed you could use the api/measures/component endpoint to retrieve the information that you want and then post the comment yourself.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.