How to trigger a Travis rebuild for my pull-request from a github comment?
After a pull-request is created on Github, the Travis PR builds triggers. And if we want to re-trigger a build, we could press the Restart Job
button on Travis GUI:
But is there a way to trigger the Restart Job
by listening to the comments in the Github Pull-Request and perhaps look for a specific comment text, e.g. [CI: Restart build]
?
In Jenkins with Cloudbees, it's possible to set the trigger phrase in the Build Triggers
section, e.g.
Is that possible in Travis too?
How to trigger a Travis rebuild for my pull-request from a github comment?
It doesn't seem to be possible from one side.
However, what you could try is to use GitHub Webhooks to listen for comments on Pull Requests. This could trigger a custom script on your server, which looks for commands inside a Pull Request comment (e.g. [CI: Restart build]
).
If the pull request contains the command, you could then trigger a new build with the Travis API.
It may be some work to realize this, but this could be a nice workaround.
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