Build server prototype (integration with GitHub / NuGet / etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
micro-build-server/BuildServer/lib/tasks/conditional.js

11 lines
472 B

"use strict";
module.exports = (params, processor) => {
const condition = (!params.owner || params.owner === processor.context.owner)
&& (!params.branch || params.branch === processor.context.branch || `refs/heads/${params.branch}` === processor.context.branch);
const task = condition
? params.task
: params.otherwise;
return { "process": () => processor.processTask(task || { "type": "noop" }, processor.done.bind(processor)) };
};