# Sonar-scan + codebuild + github + pull requests?

**URL:** <https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127>\
**Category:** SonarQube Cloud\
**Tags:** coverage\
**Created:** [October 26, 2022, 10:10pm UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127 "2022-10-26T22:10:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolhand79](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/coolhand79/32/38490_2.png) [@coolhand79](https://community.sonarsource.com/u/coolhand79)\
**Post date:** [October 26, 2022, 10:10pm UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/1 "2022-10-26T22:10:03Z")

</div>

Using sonar-scanner in codebuild, I’m getting scan results to appear in SonarCloud, but they are not found under the pr’s destination branch (in this case, `master`)

I’m running like so:

```auto
      sonar-scanner -Dsonar.host.url=https://sonarcloud.io

```

with a sonar-project.properties file like so:

```auto
sonar.projectKey=<project key>
sonar.organization=<org name>
sonar.projectName=<project name>
sonar.host.url=https://sonarcloud.io
sonar.sources=./src
sonar.tests=./test
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [October 28, 2022, 10:04am UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/2 "2022-10-28T10:04:40Z")

</div>

Hey there.

> [@coolhand79](#):
>
> I’m getting scan results to appear in SonarCloud, but they are not found under the pr’s destination branch (in this case, `master`)

I don’t quite understand what you mean – can you explain further, perhaps sharing screenshots as well?

---

<div class="post-metadata">

**Author:** ![coolhand79](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/coolhand79/32/38490_2.png) [@coolhand79](https://community.sonarsource.com/u/coolhand79)\
**Post date:** [October 28, 2022, 4:22pm UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/3 "2022-10-28T16:22:39Z")

</div>

Hi Colin, sorry, that might have been a bit confusing:

We run sonar-scanner for github pull requests.

What I expect to see is:

1. The results of the analysis under Pull Requests within sonar cloud. Instead, I see this:

 ![Image 2022-10-28 at 9.18.47 AM](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/6/5/655d46370c76df73c245176f5a2a2e1baf8af2e2.jpeg)

1. I expect to see the PR annotated within github (like the following image), but I do not.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/b/9/b991fb350bc92adb622e0487fb1415c1ff7dd072.png)

I hope that helps!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [October 31, 2022, 1:09pm UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/4 "2022-10-31T13:09:06Z")

</div>

Okay! I assume you’re running the build through GitHub actions (correct me if I’m wrong)

- Can you share the GitHub Actions YML file?
- Do you see a SonarCloud analysis run in the context of your pull request build on GitHub?

---

<div class="post-metadata">

**Author:** ![coolhand79](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/coolhand79/32/38490_2.png) [@coolhand79](https://community.sonarsource.com/u/coolhand79)\
**Post date:** [October 31, 2022, 7:05pm UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/5 "2022-10-31T19:05:26Z")

</div>

Actually, I am running them through AWS Codebuild.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [November 1, 2022, 9:13am UTC](https://community.sonarsource.com/t/sonar-scan-codebuild-github-pull-requests/75127/6 "2022-11-01T09:13:35Z")

</div>

Thanks for the clarification.

In that case – to run analysis on pull requests (since AWS CodeBuild isn’t supported out of the box), you’ll need to specify that on pull request builds a few analysis parameters are added:

> **[Other CIs](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/other-cis/)**
>
> You can run SonarCloud analysis on CI providers other than those with specific integrations.

Typically these are derived from environment variables.
