Currently we can whitelist or blacklist branches. The request is to expand the functionality to allow us to whitelist/blacklist based on label that is applied in github.
The use case is that often people make a Pull Request in github to use as a diff to show or look at part of the code. In these cases there is more code to go and its not ready, or maybe never will be, to merge. In these cases having the ability to place a github label on the pull request of say
Don't Merge is helpful.
It would be great if we could specify this in the
branches section of the
circle.yml. additionally some places may use an inverted logic and only place a tag when the actually want to merge.
general: labels: ignore: - Don't Merge only: - Good To Go
this can be done by a bash script but the problem is the ‘build’ has to start first before it knows to bail out.
if curl --silent --user $GITHUB_NAME:$GITHUB_PASSWORD https://api.github.com/repos/ORG/REPO/issues/$(echo $CI_PULL_REQUEST | grep -oE "[^/pull]+$") | grep .name | grep "Don't Merge" ; then exit 1 ; else echo "Continue Build" ; fi