(x-post from 2.0 Support - not sure which category is more appropriate)
I’ve been using git tags previously to build on CircleCI 2.0. Since about 2 weeks ago(?), it looks like a change to the checkout step is breaking builds.
Previously, the last part of the script looked like this:
if [ -n "$CIRCLE_BRANCH" ]
then
git reset --hard $CIRCLE_SHA1
git checkout -q -B $CIRCLE_BRANCH
fi
git reset --hard $CIRCLE_SHA1
The new code breaks tags:
if [ -n "$CIRCLE_TAG" ]
then
git reset --hard "$CIRCLE_SHA1"
git checkout -q "$CIRCLE_TAG"
elif [ -n "$CIRCLE_BRANCH" ]
then
git reset --hard "$CIRCLE_SHA1"
git checkout -q -B "$CIRCLE_BRANCH"
fi
git reset --hard "$CIRCLE_SHA1"
The new line git checkout -q "$CIRCLE_TAG"
is failing, because the tag ref isn’t getting pulled - only the contents of the tag are pulled.
I’ve repro’d this by trying to rebuild a historical build from 3 weeks ago. Happy to DM a link to the private repo if needed.