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

Git context fails if branch name contains a slash #1120

Open
arvidboivie opened this issue Aug 27, 2024 · 0 comments
Open

Git context fails if branch name contains a slash #1120

arvidboivie opened this issue Aug 27, 2024 · 0 comments

Comments

@arvidboivie
Copy link

Trying to set up builds with @nx-tools/nx-container on a CodeBuild with a Bitbucket Server source, I'm getting this error:

Unsupported CI Provider... Using Git as fallback
[..]
NX   Unsupported detached HEAD ref in "HEAD, origin/feature/branch-name, feature/branch-name"

As far as I can tell, this is because when using the git context (specifically on this line:

const branchMatch = ref.match(/^[^/]+\/[^/]+, (.+)$/);
) the regex fails to pick up branch names with a slash in them. I think this should be supported, since prefixes like feature/ or bugfix/ are fairly common.

Replacing the second [^/]+ with something more permissive should fix this, but perhaps there's other complexities I'm not aware of.

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