Add branch condition to Discord notification stage
Previously, the Discord notification was sent for all branches. Now, the notification will only be sent for builds on the 'main' or 'master' branches, reducing unnecessary notifications.
This commit is contained in:
Vendored
+4
@@ -55,6 +55,10 @@ pipeline {
|
||||
}
|
||||
}
|
||||
stage('discord') {
|
||||
when {
|
||||
branch 'main'
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user