From 7a33070afb45baef2879c75f5f8608e2edaa41ec Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Mon, 9 Sep 2024 18:40:59 -0300 Subject: [PATCH] Fix Git tag created in the weekly deploy Jenkins Job execution --- .ci/jenkins/Jenkinsfile.weekly.deploy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index 3805b9d509..472f9bee83 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -107,7 +107,13 @@ pipeline { script { projectVersion = getProjectVersion(false) dir(getRepoName()) { - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + 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()) }