We use this command inside an if [[ ]] statement to check whether the supplied ref is the same as the current branch. For tags and non-latest branches, it is expected to fail, so then we hit the ‘else’ branch of the if statement.
That will run a git checkout ..., which does work with tags.
Great, glad to hear you got it working!