3

So I know with BitBucket pipelines I can target tags and branches individually but I can't seem to figure out from the documentation how to make tags specific to a branch. This way if someone uses the tag on a different branch it doesn't trigger the build pipeline as it is on an incorrect branch.

Does anyone know if this is possible and how to go about it?

kennyL
  • 150
  • 1
  • 8

1 Answers1

0

I am not aware of a built-in way to do that, but you can still do it explicitly, like this:

pipelines:
  branches:
    staging:
      - step:
          script:
            - 'TAG=$(git tag -l --points-at HEAD)'
            - 'if [ "$TAG" == "expected-tag" ]; then'
            - ./a-script-or-some-more-steps.sh
            - fi

(Untested, but basically this should work.)

BlueM
  • 3,658
  • 21
  • 34