Closed joshspicer closed 3 years ago
@joshspicer This is telling you that you need a -
in front of "$.action"
. Filters is an array of mappings, not a mapping.
I was just copying the docs on this repo to illustrate the problem. Adding a -
doesn't help :(
I don't get any syntactic errors when I set it up like below, but that doesn't actually work (my incoming webhooks are not filtered by this key/value pair
Am I missing something on how filters
is supposed to behave in the first place? I want to filter based on the JSON webhook data that I receive on this pipeline. From GitHub, when a "release" webhook is sent, it's sent 3 times (with three distinct actions
.)
The JSON looks like this:
{
"action": "SOME_VALUE",
...
...
}
When SOME_VALUE
== "released" I want this pipeline to run, otherwise I don't want it to run.
@joshspicer Sorry I can't help more. The document you are referring to is a design doc and as stated in the README not maintained as permanent documentation of the product.
Hey @mjroghelia - I understand that perhaps this repo isn't the best source of information for how to use this feature. I've also tried referencing the permanent documentation on docs.microsoft.com (found here and announced here).
As you can see from my screenshot above, i've copied what is in the docs, but the filter does not get applied (My pipeline runs 3 times, even when my filter's value at the given path does not equal what is in the YAML.
For reference, this is what the docs say vs what I have in my pipeline. The JSON webhook body is sent as I shared above.
I am sent three requests from Github when a release
is created, with three different actions. My goal is to filter by the action
key.
resources:
webhooks:
- webhook: MyWebhookTrigger ### Webhook alias
connection: MyWebhookConnection ### Incoming webhook service connection
filters:
- path: repositoryName ### JSON path in the payload
value: maven-releases ### Expected value in the path provided
- path: action
value: CREATED
# Triggered on a webhook sent from
# a GitHub repo
resources:
webhooks:
- webhook: DefaultImageCreationWebhook
connection: DefaultImageCreationConnection
filters:
- path: "action"
value: "released"
Hi @joshspicer I would suggest to create ticket on https://developercommunity.visualstudio.com/search?space=21 to get right eyes on it and further help - this repo is for yaml templates mostly
sure, ill do that.
Link to the devcon issue, for anyone that stumbles upon this issue in the future
I am working on connecting an ADO YAML pipeline to be triggered by a webhook via service connection.
Looking at the documentation here on how to supply a
filter
is not correct, as visible through the YAML intellisense.
I've been unable to get filtering to work on my ADO pipeline - some advice here would be appreciated :)