Hi, I am trying to create a webhook using the cli,...
# pact-broker
t
Hi, I am trying to create a webhook using the cli, however following your documentation (see first image), I end up with an incorrect format for the "body" (see image 2). The correct result should not contains the extra double quotes (see image 3). Is there another way/syntax to properly create my webhook using the cli ? Is this a bug ?
b
Can you share the exact code that you’re using to create the webhook @TL Z?
t
Copy code
docker run --rm -e PACT_BROKER_BASE_URL -e PACT_BROKER_USERNAME -e PACT_BROKER_PASSWORD pactfoundation/pact-cli:latest pact-broker create-webhook <https://dev.azure.com/MYORGANIZATION/_apis/pipelines/1496/runs?api-version=6.0-preview.1> --request=POST --header="Content-Type: application/json" "Accept: application/json" "Authorization: Basic TOKEN" --data='{"resources":{"repositories":{"self":{"refName":"refs/heads/PactWebhookTest"}}},"variables":{}}' --provider=MYPROVIDER --description='Testing Webhook' --contract-requiring-verification-published
Hi, here is the command I used @Beth (pactflow.io/Pact Broker/pact-ruby)
b
My guess is that because the command is running via docker, the behaviour of the brackets is different to running the command directly. You could try putting the webhook body in a file and using the format `--data @name-of-your-file.json`Like this https://github.com/pactflow/example-consumer/blob/master/Makefile#L100