Possibility to only trigger webhook for a certain event

Hi,

Currently we have set up a webhook which trigger builds when a Pull Request is:

  • created
  • updated
  • approved

Now we want to trigger a separate pipeline/workflow when the Pull Request is approved.
Is there any way how we can filter on these events?

When looking to the documentation of Bitbucket Server this should be possible, based on the eventKey. (Event payload | Bitbucket Data Center 8.9 | Atlassian Documentation) But I don’t immediately see how we can filter on those events with Bitrise.

Does anybody know how we can result with this behavior?

Thanks in advance!

Hello :wave:

Currently, triggers based on PR status are not directly supported due to differences in how different Git providers manage PR statues.

You can, however, use other trigger controls to mimic this. For example, use PR labels or PR comments such that PRs with specific labels or comments can trigger builds.

You can read more about it here and here

Let me know if any questions :slight_smile:

1 Like

Hi @kaushal.bitrise,

Thanks for your answer!
Triggering builds based on comments and labels is not exactly what we’re trying to do.
We found out that there is an open-source bitrise-webhooks project on GitHub that should be used behind the scenes if I’m not mistaken.
We’ve created a Pull Request that adds the possibility to trigger a build when a reviewer approved a PR for Bitbucket Server.

You can find the PR here: add pr:reviewer:approved as a valid event for Bitbucket Server by brentvvosselen · Pull Request #198 · bitrise-io/bitrise-webhooks · GitHub

We’re hoping to have this merged anytime soon!