Skip to content

Commit bf1a020

Browse files
authored
Merge pull request #14 from distributhor/handle-curl-failures
Handle curl failures
2 parents 0932900 + 4d8bf5a commit bf1a020

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,19 @@ fi
7070

7171
echo "Content Type: $CONTENT_TYPE"
7272

73-
curl -k -v \
73+
curl -k -v --fail \
7474
-H "Content-Type: $CONTENT_TYPE" \
7575
-H "User-Agent: User-Agent: GitHub-Hookshot/760256b" \
7676
-H "X-Hub-Signature: sha1=$WEBHOOK_SIGNATURE" \
7777
-H "X-GitHub-Delivery: $GITHUB_RUN_NUMBER" \
7878
-H "X-GitHub-Event: $GITHUB_EVENT_NAME" \
7979
--data "$WEBHOOK_DATA" $WEBHOOK_ENDPOINT
8080

81+
# Curl error options ...
82+
# --silent hides the progress and error
83+
# --show-error shows the error message hidden by --silent
84+
# --fail returns an exit code > 0 when the request fails
85+
8186
# wget -q --server-response --timeout=2000 -O - \
8287
# --header="Content-Type: application/json" \
8388
# --header="User-Agent: User-Agent: GitHub-Hookshot/760256b" \

0 commit comments

Comments
 (0)