|
@@ -91,10 +91,16 @@ def commitChanges() {
|
91
|
91
|
|
92
|
92
|
// Check for changes
|
93
|
93
|
sh """
|
|
94
|
+ git status
|
94
|
95
|
git pull origin ${env.BRANCH_NAME}
|
95
|
|
- git add .
|
96
|
|
- git commit -m "Moved processed XML files to backup"
|
97
|
|
- git push --force https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME}
|
|
96
|
+ # Only proceed if there are changes
|
|
97
|
+ if [[ $(git status -s) ]]; then
|
|
98
|
+ git add .
|
|
99
|
+ git commit -m "Moved processed XML files to backup"
|
|
100
|
+ git push https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME}
|
|
101
|
+ else
|
|
102
|
+ echo "No changes to commit."
|
|
103
|
+ fi
|
98
|
104
|
"""
|
99
|
105
|
}
|
100
|
106
|
|