0

I have a multibranch pipeline which is currently using the multibranch scan webhook trigger to run a build everytime a pull request is created. I'm trying to get jenkins to trigger the build as well as parse the payload into the build as variables but can't figure it out. Have looked at sending two webhooks, one to trigger a build and the other to parse the payload information into the build but can't get it working.

Am looking to parse the payload so that I can then use the pull request details in my automation scripts that run at the end of a successful build.

Anyone done something like this before?

biglurker
  • 1
  • 1
  • I think jenkins is pulling most of its info for the PR from indexing via the API, the webhook really mainly being the trigger for new builds. what PR information are you looking for specifically? – criztovyl Jun 19 '22 at 10:31
  • Hi, I'm looking to pull the pr number, title, state, action, base, head, etc – biglurker Jun 21 '22 at 10:14
  • are you aware number (in PR-nnn format), head and base are provided in environment variables (BRANCH_NAME, CHANGE_BRANCH, CHANGE_TARGET)? the other info is rather meta (not necessary for jenkins to build), what do you intend to do with that info? have you considered calling the github api "manually" for fetching the remaining info? – criztovyl Jun 21 '22 at 16:07

0 Answers0