Forum Discussion
yaml pipeline needs tweaking every time a new collabopration branch is created
Hey,
I totally get the hassle of having to tweak the https://triotechsystems.com/yaml-pipelines-a-comprehensive-guide-for-beginners/ every time you start a new sprint and create a new collaboration branch. The good news is that there's a way to avoid hardcoding the branch name and make it more dynamic.
In Azure DevOps pipelines, you can utilize predefined variables to reference the default branch without manual modifications. By using $(Build.Repository.DefaultBranch), you'll always fetch the name of the default branch, eliminating the need to update the YAML file for each sprint.
So, no worries about making those changes anymore! Your pipeline will automatically adapt to the default branch without any manual intervention.
Let me know if you need further assistance!
- Ion1150Jun 08, 2023Copper Contributor
Awesome, will try that for sure, thanks a lot!!