Conditionally end a running job gracefully

Sometimes during a job run, you may want to end the job early. You can end a job gracefully by running the command circleci-agent step halt

 

You can combine this with if statements to control the lifecycle of the job conditionally.

run: |
if [ "$CIRCLE_BRANCH" = "develop" ]; then
circleci-agent step halt fi
Was this article helpful?
2 out of 4 found this helpful

Comments

0 comments

Please sign in to leave a comment.