circleci-orb icon indicating copy to clipboard operation
circleci-orb copied to clipboard

Can we halt CircleCI job if an environment variable is missing?

Open bahmutov opened this issue 5 years ago • 0 comments

It would be a good way to support external pull requests that are missing an environment variable like https://github.com/bahmutov/cypress-react-unit-test/pull/320

Probably would need to pass a variable to halt the job if the variable is missing

if [ -n "<<parameters.variable name>>" ]; then
   echo "Skipping the Cypress job, missing environment variable <<parameters.variable name>>"
   circleci-agent step halt
fi

bahmutov avatar Jun 26 '20 22:06 bahmutov