drone-gogs/gogs-notify

14 lines
444 B
Plaintext
Raw Normal View History

#!/bin/sh
2018-07-07 19:36:07 +00:00
URL="$PLUGIN_GOGS_URL/api/v1/repos/$DRONE_REPO/issues/$DRONE_PULL_REQUEST/comments"
2018-07-07 19:36:07 +00:00
RESULT=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GOGS_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d "{\"Body\": \"Drone Build Status: $DRONE_BUILD_STATUS\n\n$DRONE_BUILD_LINK\"}" -X POST $URL)
if [ $RESULT -eq 201 ]
then
echo "Success posting to $URL"
else
2018-07-07 23:29:02 +00:00
echo "ERROR HTTP $RESULT posting to $URL"
exit 1
fi