Skip to content

Commit ca2f391

Browse files
committed
add status code assertion to curl
1 parent dc5a4c4 commit ca2f391

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.woodpecker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ steps:
2727
from_secret: WATCHTOWER_TOKEN
2828
commands:
2929
- apk add --no-cache curl
30-
- "curl -H 'Authorization: Bearer $WATCHTOWER_TOKEN' https://togetherjava.org:5003/v1/update"
30+
- |
31+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $WATCHTOWER_TOKEN" https://togetherjava.org:5003/v1/update)
32+
if [ "$STATUS" -ne 200 ]; then
33+
echo "Error: received HTTP $STATUS"
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)