Access GitHub Push Webhook Payload in Multibranch Pipelines

Currently, Jenkins (especially in multibranch pipeline jobs using the GitHub Branch Source Plugin) does not provide access to the raw GitHub webhook push payload that triggers the build. This payload includes valuable metadata such as:

  • Whether the push created a new branch
  • Commit details
  • Files changed (added, modified, deleted)

This request is for a way to access this payload within the context of a multibranch pipeline, possibly through an extension to the SCM API or GitHub plugins.


Use Case

As a Jenkins user, I want to be able to:

  • Determine whether the build was triggered by a new branch creation or just a commit
  • See the list of files that were changed in the push
  • Access author and commit metadata (message, ID, timestamp, etc.)
  • Use this information in shared libraries and pipelines for conditional logic, auditing, notifications, etc.

Current Workarounds (and Limitations)

  1. git diff in the pipeline:
  • Requires a checkout step
  • Does not distinguish new branch creation cleanly
  • Not always accurate if the Git history is shallow or limited
  1. Generic Webhook Trigger Plugin:
  • Can parse full payload, but doesn’t integrate with multibranch pipelines
  • Requires duplicating job definitions and custom parsing

Proposal

Expose the raw webhook payload (or selected useful fields from it) via an official, stable interface that can be accessed within a Jenkins pipeline or shared library.