How to access the payload sent by a webhook?

Hi.

Is it possible to access the full payload sent by a webhook?

Currently it seems only a subset of its data it made available - through variables that Bitrise sets.

Are these variables the only source? I’m wanting to see the repository that sent the webhook. This info is definitely sent in the payload, according to the payload viewer on Github.

Thanks,
Brett

1 Like

Hi @brett,

Thanks for asking this here! :wink:

Is it possible to access the full payload sent by a webhook?

Unfortunately no.

Correct, because bitrise.io itself does not handle the webhooks. Bitrise.io provides a “Trigger API” to start builds, and there’s a separate, open source webhook processor server (https://github.com/bitrise-io/bitrise-webhooks) which receives the webhooks, converts to bitrise.io trigger api calls and then triggers the build.

May I ask why?

With a standard setup the repo which sent the hook / triggered the build is the same as the one registered for the app (the one you see on the app’s Settings tab on bitrise.io). That repo/clone URL is exposed via the $GIT_REPOSITORY_URL env var.

Thanks for the reply Viktor.

You’re correct, $GIT_REPOSITORY_URL would normally work, however I’m not dealing with a standard setup currently. I’m actually dealing with multiple related repositories - the webhook for my Bitrise project is assigned to several Github repositories, as I want it to trigger a build when a commit is pushed to any of the different repos.

Cheers,
Brett

In that case please see this discussion:

I’ll close this thread as I think it’s a duplicate of the one I linked above. If you’d have any questions feel free to leave a comment there!

This topic was automatically closed after 4 days. New replies are no longer allowed.