1

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

CuriousTechie
  • 413
  • 2
  • 8
  • 21

1 Answers1

1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250