diff --git a/Jenkinsfile b/Jenkinsfile index 050841ba3..923bae208 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,19 +4,22 @@ pipeline{ } stages{ stage("A"){ + when { + branch 'main' + } steps{ + echo "MAIN BRANCH" sh "printenv" } - post{ - always{ - echo "========always========" - } - success{ - echo "========A executed successfully========" - } - failure{ - echo "========A execution failed========" - } + } + + stage("B"){ + when { + changeRequest() + } + steps { + echo "PR" + sh "printenv" } } }