Tag/Label Filter


#1

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.

Proposal:

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


#2

we have a really similar use case, in that we wouldn’t want to run integration tests on a PR until a certain label has been assigned. The above mentioned solution would perfectly solve this for us.

It would also be sufficient if a list of active labels for a PR were added as ENV vars.


#3