diff --git a/lib/interface/cli/commands/pipeline/run.cmd.js b/lib/interface/cli/commands/pipeline/run.cmd.js index 7a63157ff..0fc77ef29 100644 --- a/lib/interface/cli/commands/pipeline/run.cmd.js +++ b/lib/interface/cli/commands/pipeline/run.cmd.js @@ -23,6 +23,14 @@ const run = new Command({ }, builder: (yargs) => { yargs + .check((argv) => { + const { trigger, branch, sha } = argv; + + if ((branch || sha) && !trigger) { + throw new Error('Validation Error: --trigger is required when using --sha or --branch'); + } + return true; + }) .option('trigger', { describe: 'Trigger id or name', alias: 't', diff --git a/package.json b/package.json index 10f17c6ed..728df2ef7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.81.0", + "version": "0.81.1", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,