Only post the webhook once
This commit is contained in:
parent
a4a9f21602
commit
ef40b86ede
1 changed files with 16 additions and 10 deletions
26
build.gradle
26
build.gradle
|
@ -312,16 +312,22 @@ def getGitChangelog = { ->
|
|||
|
||||
task sendWebhook {
|
||||
|
||||
if (System.getenv('discordWebhook') == null || System.getenv("BUILD_URL") == null) {
|
||||
println "Cannot send the webhook without the webhook url or the build url"
|
||||
return
|
||||
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
|
||||
}
|
||||
def webhook = new Webhook(System.getenv('discordWebhook'), 'HexMod Patreon Gradle')
|
||||
|
||||
def message = new Message()
|
||||
message.setUsername("Patreon early access")
|
||||
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.")
|
||||
}
|
||||
}
|
||||
def webhook = new Webhook(System.getenv('discordWebhook'), 'HexMod Patreon Gradle')
|
||||
|
||||
def message = new Message()
|
||||
message.setUsername("Patreon early access")
|
||||
message.setContent("New HexMod release! Download it here: ${System.getenv("BUILD_URL")}\nChangelog:\n${getGitChangelog()}")
|
||||
|
||||
webhook.sendMessage(message)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue