Add string parameter example to docs

Fixes #487
This commit is contained in:
Cameron Moore 2020-12-05 16:33:04 -06:00
parent 3e18a060ae
commit f2b536dbad

View file

@ -20,6 +20,7 @@ although the examples on this page all use the JSON format.
* [Travis CI webhook](#travis-ci-webhook) * [Travis CI webhook](#travis-ci-webhook)
* [XML Payload](#xml-payload) * [XML Payload](#xml-payload)
* [Multipart Form Data](#multipart-form-data) * [Multipart Form Data](#multipart-form-data)
* [Pass string arguments to command](#pass-string-arguments-to-command)
## Incoming Github webhook ## Incoming Github webhook
```json ```json
@ -589,3 +590,34 @@ Content-Disposition: form-data; name="thumb"; filename="thumb.jpg"
``` ```
We key off of the `name` attribute in the `Content-Disposition` value. We key off of the `name` attribute in the `Content-Disposition` value.
## Pass string arguments to command
To pass simple string arguments to a command, use the `string` parameter source.
The following example will pass two static string parameters ("-e 123123") to the
`execute-command` before appending the `pusher.email` value from the payload:
```json
[
{
"id": "webhook",
"execute-command": "/home/adnan/redeploy-go-webhook.sh",
"command-working-directory": "/home/adnan/go",
"pass-arguments-to-command":
[
{
"source": "string",
"name": "-e"
},
{
"source": "string",
"name": "123123"
},
{
"source": "payload",
"name": "pusher.email"
}
]
}
]
```