jreleaser: [release] JReleaser fails to checkout a custom branch

I’m trying to launch a dry-run on develop branch (snapshots) but it doesn’t work anymore on the GitHub release step.
I’m also confused about the need for JReleaser to checkout branches when skipTag property is set to true. (see below)

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem (link to git repository is ideal)
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Set property skipTag to true in GitHub release step
  2. Modify the default branch in GitHub release step
  3. Launch a dry-run

Expected Behaviour

It was ok with the previous version (v1.5.1).

Actual Behaviour

It fails in latest version (1.6.0) with the following message:

Error:  Failed to execute goal org.jreleaser:jreleaser-maven-plugin:1.6.0:full-release (default) on project sandbox-bom: Execution default of goal org.jreleaser:jreleaser-maven-plugin:1.6.0:full-release failed: Unexpected error when creating release: java.io.IOException: Could not checkout branch master: Ref master cannot be resolved -> [Help 1]

Related job: https://github.com/nbbrd/sandbox/actions/runs/4858256136 Related config: https://github.com/nbbrd/sandbox/blob/983bd7e32a287bb80789a084e1c20a02ad69b6e5/sandbox-bom/pom.xml#L162

Environment Information

  • Operating System: Ubuntu latest (GitHub Actions)
  • JReleaser Version: 1.6.0
  • JDK Version: 17

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Can confirm that 1.7.0 also fixed this for me. Thanks!

No. I’m saying that fetch-depth should remain. What should happen is this:

git checkout <branch>
git checkout <tag>

The 1st checkout is done with actions/checkout. The 2nd checkout is done with a run step with explicit call to git.

I have the same issue after updating to 1.6.0 (also using Maven), see https://github.com/wimdeblauwe/ttcli/actions/runs/4907584779/jobs/8762878937. Is there a workaround or do I need to wait for 1.7.0?

EDIT: After checking your commit, I want to add that I was running an actual build, not a dry-run when I got the exception:

Error: Failed to execute goal org.jreleaser:jreleaser-maven-plugin:1.6.0:full-release (default-cli) on project ttcli: Execution default-cli of goal org.jreleaser:jreleaser-maven-plugin:1.6.0:full-release failed: Unexpected error when creating release: java.io.IOException: Could not checkout branch main: Ref main cannot be resolved -> [Help 1]

One think I don’t understand is why JReleaser needs to check branches (other than the current branch). In my case, I “just” create a GitHub release and upload some files to it. My workflow is triggered by a tag push.