mirror of
https://github.com/jon4hz/workflow-webhook.git
synced 2025-12-19 23:56:02 +01:00
allow silent curl
This commit is contained in:
@@ -163,10 +163,19 @@ authentication is assumed not to be required. If configured, it must follow the
|
||||
The default endpoint type is JSON. The argument is only required if you wish to send urlencoded form data.
|
||||
Otherwise it's optional. <br/><br/>
|
||||
|
||||
|
||||
```yml
|
||||
silent: true
|
||||
```
|
||||
|
||||
To hide the output from curl set the argument `silent` to `true`. The default value is `false`.<br/><br/>
|
||||
|
||||
|
||||
```yml
|
||||
data: "Additional JSON or URL encoded data"
|
||||
```
|
||||
|
||||
|
||||
Additional data to include in the payload. It is optional. This data will attempted to be
|
||||
merged 'as-is' with the existing payload, and is expected to already be sanitized and valid.
|
||||
|
||||
|
||||
@@ -71,10 +71,21 @@ if [ -n "$webhook_auth" ]; then
|
||||
WEBHOOK_ENDPOINT="-u $webhook_auth $webhook_url"
|
||||
fi
|
||||
|
||||
curl -k -v --fail \
|
||||
-H "Content-Type: $CONTENT_TYPE" \
|
||||
-H "User-Agent: User-Agent: GitHub-Hookshot/760256b" \
|
||||
-H "X-Hub-Signature: sha1=$WEBHOOK_SIGNATURE" \
|
||||
-H "X-GitHub-Delivery: $GITHUB_RUN_NUMBER" \
|
||||
-H "X-GitHub-Event: $GITHUB_EVENT_NAME" \
|
||||
--data "$WEBHOOK_DATA" $WEBHOOK_ENDPOINT
|
||||
|
||||
if [ "$silent"]; then
|
||||
curl -k -v --fail -s \
|
||||
-H "Content-Type: $CONTENT_TYPE" \
|
||||
-H "User-Agent: User-Agent: GitHub-Hookshot/760256b" \
|
||||
-H "X-Hub-Signature: sha1=$WEBHOOK_SIGNATURE" \
|
||||
-H "X-GitHub-Delivery: $GITHUB_RUN_NUMBER" \
|
||||
-H "X-GitHub-Event: $GITHUB_EVENT_NAME" \
|
||||
--data "$WEBHOOK_DATA" $WEBHOOK_ENDPOINT
|
||||
else
|
||||
curl -k -v --fail \
|
||||
-H "Content-Type: $CONTENT_TYPE" \
|
||||
-H "User-Agent: User-Agent: GitHub-Hookshot/760256b" \
|
||||
-H "X-Hub-Signature: sha1=$WEBHOOK_SIGNATURE" \
|
||||
-H "X-GitHub-Delivery: $GITHUB_RUN_NUMBER" \
|
||||
-H "X-GitHub-Event: $GITHUB_EVENT_NAME" \
|
||||
--data "$WEBHOOK_DATA" $WEBHOOK_ENDPOINT
|
||||
fi
|
||||
Reference in New Issue
Block a user