Stop pipeline using a shell script

Hi, i’d like to know how can i stop a pipeline using this script below inside the pipeline.yaml:

if ! git log -1 --pretty=%B | grep -E -q ‘[skip ci]|[ci skip]|[skip-ci]|[ci-skip]’

Hi @Diogo

Actually you can use environment variable “BUILDKITE_MESSAGE” which will have the message associated with the build, usually the commit message. Then you can have first step in your pipeline which is to check if environment variable has skip in the commit message and block or cancel the pipeline.

We also have a section in our documentation which explains how to use conditionals to skip build based on commit message

I hope this answers your question. If you need any further details please let us know.