Trigger build only if user is member of Github organisation

Hello,

our opensource repository is hosted on Github and we have a lot of contributors inside and outside our company.

How to trigger build only if the PR has been raised by members of particular GH organization ?

0
8 comments

Hi,

 

If you are using a recent version of TeamCity, we created the GitHub Pull Requests plugin (which is bundled since 2018.2) to handle that scenario: https://confluence.jetbrains.com/display/TCD18/GitHub+Pull+Requests

0
Avatar
Permanently deleted user

Denis, I found that when using the GitHub Pull Requests plugin (TeamCity version 2018.2.1 (build 61078)) I found that using the "Members of the same organization" option did not work no matter what permissions we granted the Access Token.

0

Hi Jason,

 

could you be more specific with "did not work"? Could you give exact steps for reproduction of the issue?

0
Avatar
Permanently deleted user

Denis,

The steps were very simple.
In the GitHub Pull Requests with a valid access token we set By authors to 'Members of the same organization'.
The 'Test Connection' indicates success.

A member of the organization that owns the github repository makes a test commit.

No builds are triggered.

Change the By Authors to 'Members and external collaborators'
A test commit by the same user results in builds being triggered.

0

Hi Jason, 

Two questions:
What version of TeamCity are you using? Is it 2018.2 or 2018.2.1 or larger?
Is your repository private or public?

Thanks!

0
Avatar
Permanently deleted user

Hello Anton,

We are using 2018.2.1 and the repository is public.

0

Jason, what kind of authentication are you using with your pull requests build feature?

 

0
Avatar
Permanently deleted user

Anton,

As mentioned earlier we have Authentication Type set to  'Access Token' in the build feature.

(While we are discussing this it would be good to document exactly what rights the github access token needs in order for the plug-in to work correctly. It required more then we expected)

0

Please sign in to leave a comment.