Refactor conditional stage in Jenkinsfile
Updated the 'discord' stage condition to use 'anyOf' for more readable and maintainable branch checks. This change enhances the clarity of branch conditions, ensuring it triggers on either the 'main' or 'master' branches.
This commit is contained in:
Vendored
+4
-2
@@ -56,8 +56,10 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('discord') {
|
stage('discord') {
|
||||||
when {
|
when {
|
||||||
branch 'main'
|
anyOf {
|
||||||
branch 'master'
|
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