GitHub Webhook Payload

github
config

#1

For jobs triggered by GitHub-based webhooks (i.e. branch creation, pull request creation, commits, etc.), do CircleCI jobs have access to the entire webhook payload? If so, how does one access that from the CircleCI YAML config?


#2

Hi @jmdhcs - Everything collected from the payload will be placed in the default Build Environment Variables. Is there other information from the payload that you’d like to use that is not present in those variables?


#3

Thanks for the answer @Sara! A piece of information that would be valuable is what kind of pull request action is happening. For example, GitHub can issue “opened”, “reopened”, “synchronized”, and “closed” and it we want to do different things for each.


#4

This would def be helpful if it was possible to determine what type of event was being triggered. So is the PR created or closed etc…

I have looked at the env varables, but I cant see that information.


#5

My project is also having the same problem with CircleCI and GitHub. We want to trigger different actions based on whether a GitHub PR has been opened, updated or closed That info is in the POST payload, which appears to not be not available to CircleCI jobs.

This is a blocker for us so we’re looking at other CI runners now.


#6

Hi All! These are great asks and if you have a moment, please add this to our Ideas page!


#7

Good suggestion! Here’s a link for folks coming in the future. Looks like someone had posted it already:


#8

why not just interrogate the repo events to determine the last event type that took place

fyi:


#9

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.