ghprb
ghprb copied to clipboard
Detect when Pull Requests have been closed
Hello,
Is it possible for Jenkins to detect when a Github Pull Request has been closed, when using the polling method (not Github hooks).
My aim is to detect when a Pull Request has been closed and therefore execute a task accordingly (e.g cleanup on a test server to remove a Docker instance related to that previously-open Pull Request).
As far as I can tell, the 'status' of a Pull Request is not exposed as an Environment variable?
Thanks
Currently the trigger only polls open PRs, and if the plugin comtains a reference that isnt in that list it removes it internally. So you are wanting the job to be triggered when we have determined that the PR is no longer open, and I am thinking this would beed to be an optional setting that defaults to off.
Yes - basically require 2 things:
- an optional checkbox 'trigger on "closed" or "merged" event?' (so that my job will still fire)
- pass that pull request state (open, closed or merged) as an environment variable (so my job can conditionally perform a different action (destroy/cleanup) if the state is no longer open)
That would be awesome.
Thanks!
Agree with requester Would be awesome to get triggering on PR close, because in this case we are going to run server cleaner task to remove old builds data out of server. Any help will be appreciated
+1
I am also looking for same solution. Please let me know if anyone find it.
+1
👍
+1
+1
Using "GitHub hook trigger for GITScm polling" Build Triggers you can trigger Jenkins job once PR merge or closed.
+1
+1
+1
+1
+1
+1
+1
Is there any update on this?