Tags: DevOps

Encountered error(s) while parsing pipeline YAML: Could not get the latest source version for repository hosted on Azure Repos using ref refs/heads/master.

Sometimes I enjoy manually running my Azure DevOps Pipeline like this.

Manually clicking «Run pipeline» in Azure DevOps Pipelines

However, because I used a YML-file located in the Master branch when the pipeline was first created, and the Master branch has later been renamed to Main, I now get the following error every time I manually run my pipeline.

Error message: Encountered error(s) while parsing pipeline YAML: Could not get the latest source version for repository Gulla.net hosted on Azure Repos using ref refs/heads/master.

I can, of course, select the desired branch from the dropdown list every time, or even delete the Pipeline, and re-create it from another branch. However, that should not be necessary!

So, what to do?

Step 1

Select your pipeline.

Graphical user interface, select pipeline

Step 2

Click «Edit».

Graphical user interface, click «Edit»

Step 3

Click the «...»-menu, and select «Triggers».

Graphical user interface, click «...», then click «Triggers»

Step 4

Click «YAML».

Graphical user interface, click «YAML»

Step 5

Click «Get sources».

Graphical user interface, application

Step 6

Finally, select your favorite branch!

Graphical user interface, select desired branch

That's it!