From 7407372b03e042eab8c0fc7ba44e7df41af626a7 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Thu, 8 Aug 2024 20:32:43 +0200 Subject: [PATCH] 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. --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 504f75d..46e4145 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 }