# Github Token only set via UI

**URL:** <https://community.sonarsource.com/t/github-token-only-set-via-ui/2733>\
**Category:** Suggest new features\
**Tags:** tokens, pull-request, github, sonarqube-cloud\
**Created:** [September 19, 2018, 9:33pm UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733 "2018-09-19T21:33:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amparks100](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@amparks100](https://community.sonarsource.com/u/amparks100)\
**Post date:** [September 19, 2018, 9:33pm UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733/1 "2018-09-19T21:33:25Z")

</div>

Hi,

When using the github pull request functionality in SonarCoud, SonarCloud will only report as a github status and comment on a pr if the `sonar.pullrequest.github.token.secured` property is set using the UI, not during the mvn sonar:sonar command (I am not using Jenkins). I have a lot of repositories and it would be much more useful if this could be sent via code instead of having to manually setup the repositories.

---

<div class="post-metadata">

**Author:** ![max](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/max/32/14689_2.png) [@max](https://community.sonarsource.com/u/max)\
**Post date:** [September 19, 2018, 9:49pm UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733/2 "2018-09-19T21:49:21Z")

</div>

Have you set all properties in Comfiguration -\> Pull Request UI, or only the token? What properties are you passing from command line/pom properties?

---

<div class="post-metadata">

**Author:** ![amparks100](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@amparks100](https://community.sonarsource.com/u/amparks100)\
**Post date:** [September 19, 2018, 10:03pm UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733/3 "2018-09-19T22:03:11Z")

</div>

the following is my command:

```auto
mvn sonar:sonar \
      -Dsonar.projectKey=${CIRCLE_PROJECT_REPONAME} \
      -Dsonar.organization=${ORGANIZATION} \
      -Dsonar.host.url=${SONAR_URL} \
      -Dsonar.login=${SONAR_TOKEN} \
      -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} \
      -Dsonar.pullrequest.key=${CIRCLE_PR_NUMBER} \
      -Dsonar.pullrequest.provider=GitHub \
      -Dsonar.pullrequest.github.repository=toyota-connected/${CIRCLE_PROJECT_REPONAME} \
      -Dsonar.pullrequest.github.endpoint=https://api.github.com/ \
      -Dsonar.pullrequest.github.token.secured=${GITHUB_TOKEN};

```

and then via the UI i have set:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/1X/d69d3274085cb6cb833d497efc6393475aa61e7e.png)

The pull request github functionality works fine when I have both, but without the UI settings I do not get a sonarsource github status

---

<div class="post-metadata">

**Author:** ![NicoB](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicob/32/3_2.png) [@NicoB](https://community.sonarsource.com/u/NicoB)\
**Post date:** [September 20, 2018, 11:40am UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733/4 "2018-09-20T11:40:40Z")

</div>

Should this be a feature suggestion @ #[Deprecated] Suggest new features instead ? Seems like current behaviour, more than a bug per-se. And it would be interesting to detail the use-case in more length, because that I might open up other solutions the the one you mention (e.g. if the token is valid for multiple projects, than an organization-wide settings in :sonarcloud: could maybe help).

---

<div class="post-metadata">

**Author:** ![amparks100](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@amparks100](https://community.sonarsource.com/u/amparks100)\
**Post date:** [September 20, 2018, 1:42pm UTC](https://community.sonarsource.com/t/github-token-only-set-via-ui/2733/5 "2018-09-20T13:42:38Z")

</div>

Yes, this is probably more of a #suggestions . Organization-wide settings would definitely be more useful in our scenarios
