Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update release branch patterns to include heads/ prefix #260

Open
TheFriendlyCoder opened this issue Mar 13, 2024 · 1 comment
Open

update release branch patterns to include heads/ prefix #260

TheFriendlyCoder opened this issue Mar 13, 2024 · 1 comment

Comments

@TheFriendlyCoder
Copy link

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
Copy link
Author

This problem is somewhat related to this one since some people work around building from a detached head by manually creating a local branch with the same name as the tag to satisfy the Nebula requirements.

I thought it best to create a separate bug for this specific use case though since it is possible it may be reproducible in other situations as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant