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:
1 parent
973b6b5e7d
commit
7407372b03
1 file changed
+4
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