Skip to content

Commit

Permalink
Improve error logging for tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Jan 17, 2024
1 parent 714cd39 commit 4e96a06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ class ReleasePluginIntegrationSpec extends GitVersioningIntegrationTestKitSpec {
git.checkout(branch: 'main', createBranch: true)

when:
def result = runTasks('final')
def result = runTasks('final', '-i')

then:
result.task(':final').outcome == TaskOutcome.SUCCESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ abstract class ReleaseTask extends DefaultTask {
GitWriteCommandsUtil gitCommands = gitWriteCommandsUtil.get()
String tagName = tagStrategy.get().maybeCreateTag(gitCommands, projectVersion.get())
if (tagName) {
logger.warn('Pushing changes in {} to {}', tagName, remote.get())
logger.info('Pushing changes in {} to {}', tagName, remote.get())
gitCommands.pushTag(remote.get(), tagName)
} else {
logger.warn('No new tags to push for {}', remote.get())
logger.info('No new tags to push for {}', remote.get())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class GitWriteCommandsUtil implements Serializable {
try {
executeGitCommand("push", remote, tag)
} catch (Exception e) {
if(e.message.contains("* [new tag]")){
return
}
logger.error("Failed to push tag ${tag} to remote ${remote}", e)
}
}
Expand Down

0 comments on commit 4e96a06

Please sign in to comment.