The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i skip step according to conditions

tagnpin_dev1
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2019

definitions:

steps-

step- #1

step- #2 

wanna to skip step 2 according to condition 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
dziugas_mikalkenas
Contributor
August 5, 2022

as theres no out of the box solution from atlassian, what i did was something like:

- step:
     script:
- |
if something exists; then
        echo true > condition.txt
fi
     artifacts:
- condition.txt
- step:
script:
- |
if $(cat condition.txt); then
exit 0
fi
- do stuff
i know this is bullshit as it still has to go through `build setup` on each step which check for this condition, which takes time... but its still better than nothing
0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2020

Hello,

Right now there isn't an option in the YAML to skip steps.

You could try marking the step as 'manual' if it's always going to be the last step, and just require it to be manually triggered.

Or you'll need to add your conditions to the start of the step. You can then just use 'exit 0' to finish the step early with a "successful" status and continue on with the pipeline.

You can also open a feature request for this here: https://jira.atlassian.com/secure/CreateIssue!default.jspa

Thanks,

Phil

Oakeshia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2021

I am also facing the same issue. I have raised a suggestion.

https://jira.atlassian.com/browse/BCLOUD-20833.

Like Mateusz Przybyłek likes this
TAGS
AUG Leaders

Atlassian Community Events