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?
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.