My bitbucket pipeline is triggered by a tag.
I am running a bash script within the pipeline step.
I am using this command to get all the git branches that have the tag that triggered the pipeline.
git branch --contains tags/$1
The bash script works fine on my local (same docker env as the bitbucket pipeline). I made sure I had checked out the tag in git before running the bash script.
I get the following result
* (HEAD detached at <commit>)
<branch-name>
But when I run the actual pipeline, I get the following output for the above command -
* (no branch)
UPDATE:
I added more git debug commands to see if any of the concerned branches exist inside the docker when the pipeline runs.
git fetch
git show-branch master
I get this error -
<span>fatal: bad sha1 reference master</span>
Any idea why this is happening ?