enh: Added safety to not ping updates role if changelog fails to upload

This commit is contained in:
lv 2021-03-25 17:08:13 -04:00
parent 05f7959031
commit 9d20f1c306
No known key found for this signature in database
GPG Key ID: AF236A45B0255DA8
1 changed files with 8 additions and 4 deletions

View File

@ -50,6 +50,14 @@ JAR_NAME="$("$_d"/scripts/buildJarSafe.sh)" || exit $?
REPO="$KAMI_REPO_NIGHTLY"
[ "$1" == "major" ] && REPO="$KAMI_REPO_MAJOR"
# Send changelog embed
curl -H "Content-Type: application/json" -X POST \
-d '{"embeds": [{"title": "Download v'"$VERSION"'","color": 10195199,"description": "[**DOWNLOAD**](https://github.com/'"$KAMI_OWNER"'/'"$REPO"'/releases/download/'"$VERSION"'/'"$JAR_NAME"')\n\n**Changelog:** \n'"$CHANGELOG"'\n\nDiff: ['"$OLD_COMMIT"'...'"$HEAD"'](https://github.com/'"$KAMI_OWNER"'/'"$REPO"'/compare/'"$OLD_COMMIT"'...'"$HEAD"') "}]}' \
"$KAMI_WEBHOOK" || {
echo "[runAutomatedRelease] Failed to post changelog embed"
exit 1
}
# Send ping
if [ -n "$KAMI_UPDATES_ROLE_ID" ]; then
curl -X POST \
@ -57,7 +65,3 @@ if [ -n "$KAMI_UPDATES_ROLE_ID" ]; then
-d '{"username": "", "content": "<@&'"$KAMI_UPDATES_ROLE_ID"'>"}' \
"$KAMI_WEBHOOK"
fi
# Send changelog embed
curl -H "Content-Type: application/json" -X POST \
-d '{"embeds": [{"title": "Download v'"$VERSION"'","color": 10195199,"description": "[**DOWNLOAD**](https://github.com/'"$KAMI_OWNER"'/'"$REPO"'/releases/download/'"$VERSION"'/'"$JAR_NAME"')\n\n**Changelog:** \n'"$CHANGELOG"'\n\nDiff: ['"$OLD_COMMIT"'...'"$HEAD"'](https://github.com/'"$KAMI_OWNER"'/'"$REPO"'/compare/'"$OLD_COMMIT"'...'"$HEAD"') "}]}' "$KAMI_WEBHOOK"