I'm currently trying to adopt my declarative pipeline in the following way:
I have multiple stages, some apply for all branches, some only for specific names.
What I'm now searching for is a way to get a when condition for the existance of a branch like this:
if branch b exist checkout branch b else checkout branch a
Sadly I haven't found a solution for it. I'm pretty sure there is a way using the git plugin though.
There's a StackOverflow solution for scripted pipelines, but I can't translate them though.
Can someone help me with this or point me at the right direction?