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 -
fatal: bad sha1 reference master
Any idea why this is happening ?
I have the same issue, did you ever get an answer to this... been trying for days to work out how to commit back to the original branch the build ID increment that was triggered by a publish tag...
I've tried lots of methods, even querying the git origin... none have worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.