diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index dcde5ce02e..22c14eae4c 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -157,8 +157,14 @@ pipeline { steps { script { projectVersion = getProjectVersion(false) - dir(optaplannerFolder) { - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + dir(optaplannerFolder)) { + if (githubscm.isThereAnyChanges()) { + def commitMsg = "[${getBuildBranch()}] Update version to ${projectVersion}" + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') }) + } else { + println '[WARN] no changes to commit' + } githubscm.tagRepository(projectVersion) githubscm.pushRemoteTag('origin', projectVersion, getGitAuthorPushCredsId()) }