Add branch condition to Discord notification stage
The Discord notification stage now runs only on 'main' or 'master' branches. This helps to avoid unnecessary notifications for feature or bugfix branches.
This commit is contained in:
Vendored
+6
@@ -12,6 +12,12 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('discord') {
|
stage('discord') {
|
||||||
|
when {
|
||||||
|
anyOf {
|
||||||
|
branch 'main'
|
||||||
|
branch 'master'
|
||||||
|
}
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user