circleci-cli
circleci-cli copied to clipboard
Passing trigger in with HEAD ref creates a branch called HEAD on CircleCI
Spent quite a bit of time tracking this down with CircleCI. We started getting mysterious build failures with a warning like this when attempting to check out:
warning: refname 'HEAD' is ambiguous.
fatal: Ambiguous object name: 'HEAD'.
Exited with code 128
It turns out we had an earlier build that one of our devs triggered using the circleci-cli with HEADas the branch argument passed to the trigger command. This did not get interpolated to the actual HEAD ref, and instead created a branch in CircleCI with this name. This build failed with the same ambiguous object error, but the result of this build got cached which made downstream builds also fail because they still had the local branch with this name.