I have integrated my GitHub repo with Travis. Currently, I can run git push origin master
, and then see a Travis build error a few minutes later, meaning I have a broken master build.
Is there any way I can stop git accepting the push if Travis fails to run?
I know I can just push to a git branch and then only merge it if it runs cleanly, but I was wondering if there was any way to get git itself to refuse to acccept the push.
Travis only sees your code when you push to the remote github repo. So no, the only way you can do this is to use branches like they were intended in git.
The correct process is to write your new code on a branch. Push to that branch. Create a pull request in github. Then only merge to master if the Travis build passes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With