简体   繁体   中英

Git webhook does not trigger Jenkins build when pushed from remote branch

Jenkins build is not triggered by the git webhook when pushed changes from a remote repository branch

I have the main git repository (upstream) and the forked git repository (origin). When I push changes to upstream/master, I expect the Jenkins build to start automatically.

Case 1: Created Pull request and merged origin/my_branch into upstream/master using the "Merge Pull Request" button from GitHub web interface

Case 2: Created Pull request and merged origin/my_branch into upstream/master using the command line git push upstream my_branch:master

Firstly, I would like to know the difference between case 1 and case 2 merges

My observation is that git webhook trigger works perfectly in case 1 but in case 2 git webhook failed to trigger the Jenkins build. Did anyone face the same issue?

Please help me understand the difference here. thanks in advance

It depends on what type of event your webhook was created for.

If it is a pull request event , then case 1 will trigger it (which, in turn, will activate your listener, here a Jenkins instance).
Case two is just a push event, not a PR one: you are pushing directly to upstream, instead of pushing to origin (your fork) and making a PR from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM