I have added yaml templates for .Net CI CD pipeline in a separate repository named 'DevOps'. Each .Net service pipeline is calling this yaml template from 'DevOps'.
In DevOps I have two branches - one is main and one is beta.
All the triggers from source/development branches in .Net service pipeline should use the template in beta branch of 'DevOps'. Pipeline trigger from main branch in .Net service pipeline should use the template in main.- this is the requirement.
I have used regular expression/if condition/syntax using when/if, all these are either throwing expression/condition error or simply take the template from main. Below is the screenshot of various attempts (older ones are commented) I have made.
Is there a way to implement a condition in repository syntax?
Update: I have updated pipeline like below as per Kotaro's solution. I hope variable can be added inside resource syntax
But this is what I am getting when I try to run the pipeline: