How to trigger a Travis rebuild for my pull-request from a GitHub comment?
Asked Answered
I

1

6

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:

enter image description here

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.

enter image description here

Is that possible in Travis too?

How to trigger a Travis rebuild for my pull-request from a github comment?

Industrious answered 3/10, 2018 at 5:52 Comment(0)
C
9

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.

Change answered 14/10, 2018 at 10:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.