Hey team! I'm creating a global webhook for all re...
# pactflow
a
Hey team! I'm creating a global webhook for all repos to post Pact Verification results in a comment to our PRs, as it is described here. Unfortunately, the names of the services in Pactflow vary and not all of them match the repo names. I wonder if I can use a providerLabel instead of
${pactbroker.providerName}
. Among others, I have a label service=name-of-my-service. Can I use something like
${pactbroker.providerName[service]}
to get it?
m
Among others, I have a label service=name-of-my-service. Can I use something like
${pactbroker.providerName[service]}
to get it?
no, it doesn’t work like that
You could potentially add a PR to the pact broker to do so - but possibly a simpler/better PR would be to add regex or other matching to the provider name
what are you actually needing the provider name for in the webhook?
a
Hey Matt, thank you for your answer! I just realised that made a typo in the desired string I wanted to use
${pactbroker.providerLabels}
and get a label from a comma-separated string
m
yeah, I figured that was it. But it still doesn’t work like that - it will just send a list of comma separated labels in that value to the webhook target - you would have to split it there
(sorry just off to bed - late here - but will look tomorrow if you can elaborate more on the use case)
(or somebody else might chime in 🙂 )