From 2bf715eed8aefcab73cef46423480f9c58372de7 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 5 Feb 2026 14:40:26 +0100 Subject: [PATCH] chore: add toggle for enabling/disabling PR pipelines in Jenkinsfile --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83c84e10393..895e8deb0ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,12 +10,14 @@ pipeline { environment { CREDENTIALS = credentials('GITHUB_TOKEN_ANDROID') WIRE_BOT_SECRET = credentials('JENKINSBOT_ANDROID_CRITICAL_FLOWS') + // Toggle to enable/disable PR pipelines quickly. + ENABLE_PR_PIPELINE = "false" } stages { stage("Wait for GitHub action to finish") { when { - expression { BRANCH_NAME ==~ /PR-[0-9]+/ } + expression { env.ENABLE_PR_PIPELINE == 'true' && BRANCH_NAME ==~ /PR-[0-9]+/ } } steps { script { @@ -100,7 +102,7 @@ pipeline { stage("QA Tests") { when { - expression { BRANCH_NAME ==~ /PR-[0-9]+/ } + expression { env.ENABLE_PR_PIPELINE == 'true' && BRANCH_NAME ==~ /PR-[0-9]+/ } } steps { script { @@ -131,7 +133,7 @@ pipeline { post { success { script { - if (env.BRANCH_NAME ==~ /PR-[0-9]+/) { + if (env.ENABLE_PR_PIPELINE == 'true' && env.BRANCH_NAME ==~ /PR-[0-9]+/) { wireSend(secret: env.WIRE_BOT_SECRET, message: "✅ **$BRANCH_NAME**\n[$CHANGE_TITLE](${CHANGE_URL})\nQA-Jenkins - Tests successful (see above report)") } }