Conditional Build with PR Label

Hi,

Would be nice a way to indicate whether a particular PR should be built or not. Github allows you to label PRs, so I figured if we could somehow leverage the presence of a particular label or text in commit into the Continua CI build, we would have a good way of letting Continua CI know which PRs to ignore, until they were feature complete and ready to be built.

Some background for the feature:


Hi Rafael,

You can currently use Comment Filters in Repository Triggers to filter the changesets which trigger a build by matching text in a commit comment.

We have plans utilise the GitHub API more in the future, to pull in extra information like labels.

Meanwhile, you should be able to use the HTTP Request build event handler, to query the GitHub API as in your first link.

You could set this to run On Build Created or On Before Build Queued, and use the pull request id extracted from the branch in the resource field.

e.g. /repos/Owner/RepoName/pulls/$Source.RepoName.Branch.Split(\"/\").Last()$

If you set a variable based on the response, e.g. %PullRequestLabelFound% or %PullRequestLabelId%, this can be used in a Configuration Condition to discard the build if a label is not found.

Thanks Sparky,

I think your suggestions will meet my needs.

I confess that I’m still at the beginning of the learning curve, trying to understand everything the Continua CI can do.

Best Regards,