Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Avoiding faulty manual triggering for Pipelines on branches

Amitav Chris Mostafa
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!
May 10, 2024

I want to add a conditional check on my .yml file to filter out which branched the pipelines should run on. The reason behind this being, it is still possible to manually trigger a build on a feature or bugfix branch by any user.

script: - echo "Running on branch $BITBUCKET_BRANCH" - if [ "$BITBUCKET_BRANCH" != "development" ] && [ "$BITBUCKET_BRANCH" != "main" ]; then echo "Pipeline execution is restricted to the development and main branches." exit 1 fi

 

This is my working logic. 

Why is this being overridden on manual runs? 

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2024

Hi Amitav,

Unfortunately - it's not yet possible to restrict who is able to run pipelines using the manual trigger feature. We have a feature request below that you may Watch for future updates and Vote for to improve its visibility with regard to customer demand:

The only preventative measures available are for Premium customers and they relate to deployments specifically - wherein deployments to certain environments may be restricted to admins only, and only for certain branches, this is not for all Pipelines in general however:

Cheers!

- Ben (Bitbucket Cloud Support)

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events