Manually fail pipeline for incorrect branch

Greg Mascherino
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 6, 2018

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.

1 answer

1 vote
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events