nebula-release-plugin icon indicating copy to clipboard operation
nebula-release-plugin copied to clipboard

update release branch patterns to include heads/ prefix

Open TheFriendlyCoder opened this issue 4 months ago • 1 comments

The code here defines a set of regular expressions for patterns that should match any branch from which releases should be permitted. Among this default set I would recommend adding one for any branch that is named with a heads/ prefix.

Based on the logic I found here the plugin is making use of the git rev-parse command to retrieve the name of the current branch. If the name of the current branch is unique within the local workspace then this command will return the name of the branch, unqualified, as in branchname. But if the name of the branch is shared with another refspec, say a tag of the same name, then this command will return the branch name as heads/branchname. In this case the name of the branch will fail the recognized release branch checks and the plugin will fail to properly label the release.

You can reproduce this situation on any local git checkout by doing the following:

# create a tag
git tag 1.0.0
# create a branch of the same name
git checkout -b 1.0.0
# check the refspec of the current branch
git rev-parse --abbrev-ref HEAD
> heads/1.0.0

TheFriendlyCoder avatar Mar 13 '24 20:03 TheFriendlyCoder