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?