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

Warn user when pushing to branch not listed in bitbucket-pipelines.yml

dembryrfx
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!
June 25, 2024

Hi, My team and I work on static website projects which usually have "development" and "master" branches.  In some of them, bitbucket-pipelines.yml is configured so that it ONLY runs a build in specific branches.  When they try to push to other branches I want to give them some indication or warning, somehow.  My current hacky technique is to add a `default` section that triggers a build failure.  A simple example:

pipelines:
default:
- step:
script:
- |
echo "BUILDS NOT CONFIGURED FOR THIS BRANCH; PLEASE MERGE INTO DEVELOPMENT" >&2
exit 1 # trigger a build failure.
branches:
development:
...
master:
...

The unfortunate thing about this is that it still spins up a Docker image which is wasteful and time-consuming.  I would rather issue a message of some kind to the unlisted branch pusher sooner and with more efficient use of resources.  Has anyone a better method?

1 answer

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

Hi @dembryrfx 

Unfortunately, this is not possible in Bitbucket Cloud. We have a feature request to allow for hook support in Bitbucket Cloud that would handle your use case. I would recommend Watching and Voting for so that you increase its visibility with regard to customer demand and receive updates related to it:

Cheers!

- Ben (Bitbucket Cloud Support)

 

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events