Exception while using custom releaseTagName with pushChanges in sbt-release

341 views Asked by At

I'm setting a custom tag name as part of release process using sbt-release

releaseTagName := s"v${version.value}-${name.value}",

Problem is, during the pushChanges release step where tags are pushed to github, it seems to use two tags.

  [info]  * [new tag]         list -> list
  [info]  * [new tag]         v0.3-primary -> v0.3-primary
  [info]  ! [rejected]        v0.1 -> v0.1 (already exists)

v0.3-primary is the one I configured with releaseTagName. Tag v0.1 already exists and hence this step fails. I can't seem to figure why its pushing this tag.

  [info] Setting version to '0.4-SNAPSHOT'.
  [info] Reapplying settings...
  [info] Set current project to primary (in build file:/source/capture-app/)
  [info] [master b594aeb] Setting version to 0.4-SNAPSHOT
  [info]  1 file changed, 1 insertion(+), 1 deletion(-)
  Push changes to the remote repository (y/n)? [y]
  [info]    4f29ecf..b594aeb  master -> master
  [info] To https://github.com/...
  [info]  * [new tag]         list -> list
  [info]  * [new tag]         v0.3-primary -> v0.3-primary
  [info]  ! [rejected]        v0.1 -> v0.1 (already exists)
  [info] error: failed to push some refs to 'https://github.com/...
  [info] hint: Updates were rejected because the tag already exists in the remote.
  java.lang.RuntimeException: Nonzero exit value: 1
          at scala.sys.package$.error(package.scala:27)
          at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:131)
          at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:102)
          at sbtrelease.ReleaseStateTransformations$$anonfun$pushChangesAction$1.apply(ReleaseExtra.scala:258)
          at sbtrelease.ReleaseStateTransformations$$anonfun$pushChangesAction$1.apply(ReleaseExtra.scala:245)

Anyone has an explanation on what's going on?

0

There are 0 answers