From 6d694d2bfa8ff6bb764af02a9d6223319653151a Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 10 Sep 2024 11:13:10 -0300 Subject: [PATCH] NO-ISSUE: Fix Git tag creation 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 fa762daf0..5ae76b2bb 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -128,7 +128,13 @@ pipeline { script { projectVersion = getProjectVersion() 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()) }