From 46d4c66dbc0f74d9706a21b00ddb21a21e652702 Mon Sep 17 00:00:00 2001 From: RebeccaNod1 Date: Tue, 12 Aug 2025 06:36:48 -0500 Subject: [PATCH] fix jenkins branch detection for conditional stages --- Jenkinsfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0dea8b6..416bf4c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,7 +41,9 @@ pipeline { when { anyOf { branch 'main' + branch 'origin/main' branch 'develop' + branch 'origin/develop' } } steps { @@ -59,7 +61,10 @@ pipeline { stage('Generate Release Package') { when { - branch 'main' + anyOf { + branch 'main' + branch 'origin/main' + } } steps { echo "📦 Creating release package..." @@ -101,7 +106,10 @@ pipeline { stage('Update Documentation') { when { - branch 'main' + anyOf { + branch 'main' + branch 'origin/main' + } } steps { echo "📚 Updating project documentation..." @@ -126,7 +134,10 @@ pipeline { stage('Notify Success') { when { - branch 'main' + anyOf { + branch 'main' + branch 'origin/main' + } } steps { echo "🎉 Build completed successfully!"