Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to cancel/not execute Bitbucket Pipelines builds based on a condition?

Alejandro Cotilla November 5, 2018

I want to update my yml file to ignore commits from certain users. Is this possible? Is there a similar solution? Ideally I wouldn't even want to trigger the build in the first place.

Pseudo code example of yml file (ignore syntax, I'm just showcasing what I'm trying to do)

user = git show -s --format='%ae' $BITBUCKET_COMMIT
unwantedUser = "person@mail.com"

pipelines:
tags:
'**' && user != unwantedUser:
- step:
script:
(...)

 

What would be the actual syntax to achieve that?

1 answer

0 votes
Alejandro Cotilla November 5, 2018

I ended up including the [skip ci] string in my commit messages to avoid triggering the pipeline.

https://stackoverflow.com/a/53162706/1792699

Patrick Nelson October 15, 2021

Thanks for taking a moment to answer your own question!

Like Alejandro Cotilla likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events