From 24264d263002897815f0b0377510765955c698a8 Mon Sep 17 00:00:00 2001 From: Avinash Date: Sat, 14 Oct 2023 01:25:25 +0530 Subject: [PATCH] modified jenkins files --- Jenkinsfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8d5fac5..703d948 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,10 +91,16 @@ def commitChanges() { // Check for changes sh """ + git status git pull origin ${env.BRANCH_NAME} - git add . - git commit -m "Moved processed XML files to backup" - git push --force https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME} + # Only proceed if there are changes + if [[ $(git status -s) ]]; then + git add . + git commit -m "Moved processed XML files to backup" + git push https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME} + else + echo "No changes to commit." + fi """ }