Webhook per environment branch

I am setting up webhooks for my project.
Currently we can only set the environment on which we want to run the webhook during a modification. It would be interesting to be even more specific and to do it by environment branch. There are a number of cases where this can be very useful.

In my case I want to trigger gitlab pipelines when modifying environments, I want to do it on all “parent” environments but not on the branches.

For example I have 2 branches for my staging environment, I only want to trigger a pipeline for my staging environment, but when modifying a variable I have three calls on the webhook (1 for the parent environment and 2 for branches)

Hi @mayeul,

That’s a really interesting use case for restricting a webhook to a specific config and I’ll pass this on to our product team for consideration.

As a workaround, could you add code to your Gitlab pipeline that will abort the run if the name and environment properties in the config object from the webhook payload match?

See our webhook documentation for the JSON payload structure.

Hi @ryan-blunden,
Thanks for your answer. That’s what i ended up doing and it works fine.
But it will be “cleaner” in the future if we can specify directly on doppler on which branch to trigger the webhook.

Glad you got it sorted and I’ll let you know once I know more.