Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow Travis-CI access to a GitHub organisation with restricted applications access?

If I try to click the “flip switch” next to a new repository in my Travis account, the flip switches but the hooks are never configured and I cannot trigger a build in Travis.

If I look at the console, I can read the following error:

XMLHttpRequest cannot load https://api.travis-ci.org/hooks/123456. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://travis-ci.org' is therefore not allowed access. The response had HTTP status code 500.

This may be linked to my GitHub organisation having activated third-party applications restrictions. Yet, all my previous repositories still build fine, and it's been weeks!

How can I start building a new repository in my Travis organisation account?

like image 475
MattiSG Avatar asked Mar 05 '15 10:03

MattiSG


1 Answers

This is indeed linked to your organisation having third-party application restrictions, or “third-party whitelisting”.

You may not detect the problem at first since your current public repositories still receive web hooks, so it may be weeks before you get issues with Travis, and the connection with activation may be long lost in your mind.

So, now you've figured out these weird CORS/500 are linked to third-party application restrictions, you need to grant access to Travis again. But how? Travis has already been allowed access and won't ask you again for it upon login!

You have to go to your own user-approved application list in your GitHub profile, and click “View” next to the Travis-CI listing. If you scroll down, you will get an “Organization access” listing. Your restricted organisation should be listed here, with a cross next to its name. Click “Grant access” to allow Travis into your org.

Everything should be in order now, and you should be able to activate Travis for your repo! You will just need to trigger a build by pushing a new commit after having “flipped the switch”.

like image 142
MattiSG Avatar answered Oct 23 '22 04:10

MattiSG