Open dclayton-godaddy opened 3 years ago
Before I get started, I want to make sure this is something that has an opportunity to get merged.
I'd love this.
because with the current implementation, we have to define multiple Cause Objects, to find out, what has triggered the job:
def triggerCommentCause = currentBuild.rawBuild.getCause(org.jenkinsci.plugins.pipeline.github.trigger.IssueCommentCause)
if (triggerCommentCause) {
echo("build was started by a github trigger")
} else {
echo('Build was not started by a trigger')
}
def triggerReviewCause = currentBuild.rawBuild.getCause(org.jenkinsci.plugins.pipeline.github.trigger.PullRequestReviewCause)
if (triggerReviewCause) {
echo("build was started by a github trigger")
} else {
echo('Build was not started by a trigger')
}
for backwards ability you have to add the githubEventTrigger
additionally to the existing triggers.
for the githubEventTriggerCause
, i would suggest, that it should have the github events public properties (https://developer.github.com/v3/activity/event_types/#event-object-common-properties) maybe exluding the id
Sweet! We'll look at submitting a PR on this. You think it will get approved if it has unit tests, etc? Not a fan of maintaining forks as I've had with many other plugins.
Sorry for the confusion, I'm no maintainer, was just giving my 2 ct :)
Sure. I was asking because you had successful commits. :)
hehe, ok, @aaronjwhiteside was kind of fast in merging the PRs, and @aaronwalker did the main work for the latest trigger
@dclayton-godaddy had exactly the same thought while implementing the PR review trigger. Happy to test and provide feedback and also work to get it merged as quickly as possible.
Not sure what the status or progress here is. I can help out with this as well.
Hi all. Sorry, been super busy. I haven't started if someone else has the time. We've started looking at the Checks API plugin to handle checks which was one of the use-cases we wanted.
I'd like to take a crack at this, should hopefully have a PR up in a week or two.
Having some issues because it's so generic. Would the expectation be that
githubEventTrigger("pull_request", payloadFilter: ["action": "closed"])
would only run on the Pull Request Job that the event is about? What about events that aren't related to a particular branch or PR like deployment
or gollumn
or issues
?
Should we add an optional "job name regex" option to the trigger that only trigger a branch/tag/pr with that name?
Ya, my thought was to allow for a full JSON filter. This would mean you could filter by branch as well, correct? Awesome you're working on that! Thanks
I'd love to submit a PR to create a GitHubEventTrigger to allow all events to be captured in pipeline. All events sent to the master can cause a build to be triggered if the pipeline has
githubEventTrigger
with the event name and apayloadFilter
. This will save us from having to continuously update this plugin for future supported events of GitHub.or