Heya! I'd like to create(-or-update) a webhook via...
# pact-broker
k
Heya! I'd like to create(-or-update) a webhook via the cli. According to the docs it should be possible to pass the webhook payload from a file or string. How can I specify that I want the contents to be read from a file? Right now I get the file path as raw string content 🙈 Ive been looking for examples but I couldnt find anything anywhere. Currently my command is:
Copy code
pact-broker create-or-update-webhook <url> --uuid=968fcd0f-a647-4419-aeec-637ad5e5287e --request=POST --header="PRIVATE-TOKEN: \${user.GitlabAccessToken} CONTENT-TYPE: application/json" --data=/Users/Kevin/TKP/repos/upa-verlof/webhook_data.json --consumer=upa-verlof --provider=ppsadapter --contract-content-changed --team-uuid=4ac05ed8-9e3b-4159-96c0-ad19e3b93658 --broker-base-url=<broker url> -k <token>
m
That specifies the request body that is sent in the webhook, including any parameters: Here are a couple of examples: • Provider build trigger: https://github.com/pactflow/example-provider/blob/master/Makefile#L86-L96 • GitHub status check: https://github.com/pactflow/example-consumer/blob/master/Makefile#L102-L113 Other templates: https://docs.pact.io/pact_broker/webhooks/template_library
k
Ah I just tried and I figured its the '@' that marks the value as being a file path and not the content string? I coudnt find that anywhere in the documentation.
m
That’s a good point. I’ve raised https://github.com/pact-foundation/pact_broker-client/issues/144 to track
b
How’s this?
k
Ah, so the @ was inherited from curl? Yes I think this help text will help a lot for those who didnt know (me 😄)
🙌 1
👍🏼 1