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:
Teriuihi 2024-08-08 20:32:43 +02:00
parent 973b6b5e7d
commit 7407372b03

4
Jenkinsfile vendored
View File

@ -55,6 +55,10 @@ pipeline {
} }
} }
stage('discord') { stage('discord') {
when {
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
} }