Atlassian has recently updated pipelines to allow manually triggering any build task from any branch. This means that users can run the master branch pipeline from a feature branch for example. How do I prevent manually running tasks for the incorrect branch? There are currently no pipeline permissions nor is there anyway to limit a specific build to a specific branch.
Hi Greg,
You can check the branch that's running at the start of your build and fail from there.
For example:
- if [ "$BITBUCKET_BRANCH" != "master" ]; then exit 1; fi
- ... #the rest of your script
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.