Only post the webhook once

This commit is contained in:
Jared 2022-04-04 22:13:25 +02:00
parent a4a9f21602
commit ef40b86ede
No known key found for this signature in database
GPG key ID: DB3BA3B9088A1BDF

View file

@ -312,6 +312,8 @@ def getGitChangelog = { ->
task sendWebhook {
doLast {
try {
if (System.getenv('discordWebhook') == null || System.getenv("BUILD_URL") == null) {
println "Cannot send the webhook without the webhook url or the build url"
return
@ -323,5 +325,9 @@ task sendWebhook {
message.setContent("New HexMod release! Download it here: ${System.getenv("BUILD_URL")}\nChangelog:\n${getGitChangelog()}")
webhook.sendMessage(message)
} catch (ignored) {
project.logger.error("Failed to push Discord webhook.")
}
}
}