Jenkins 2.0 validate pull request message

487 Views Asked by At

We use Jenkins 2.0 with the new multibranch pipeline job. Each pull request generates a new job PR-{number}. We want to make some validations on the pull request messages.

Is there any way to get the pull request message inside the Pipeline script?

Thank you in advance for any information.

1

There are 1 best solutions below

0
stigsb On BEST ANSWER

You can easily get the PR title with env.CHANGE_TITLE, but for the message body you'll have to do an API call to GitHub.