microsoft/azure-pipelines-yaml

Error running pipeline after renaming default GitHub branch from 'master' to 'main'

jzabroski opened this issue · 3 comments

I recently changed my repository github.com/fluentmigrator/fluentmigrator to use "main" instead of "master". In Azure Pipelines, I am getting the following error when I click Run Pipeline from the web UI:

Encountered error(s) while parsing pipeline YAML:
Could not get the latest source version for repository fluentmigrator/fluentmigrator hosted on https://github.com/ using ref refs/heads/master. GitHub reported the error, "No commit found for SHA: refs/heads/master"

My pipeline file is https://github.com/fluentmigrator/fluentmigrator/blob/main/azure-pipelines.yml

When I click Validate on this pipeline, it returns OK.

The triggers are configured as:

trigger:
  branches:
    include:
    - release/*
    - main
  tags:
    include:
    - v1.*
    - v2.*
    - v3.*
    - v4.*
    - v5.*

pr: none

What's strange is Pull Requests in a separate yaml file are working correctly: https://github.com/fluentmigrator/fluentmigrator/blob/main/azure-pipelines-pullrequests.yml

I am honestly stumped as to what went wrong. It seems as though Azure Pipelines has cached my old default branch as master, hence why I am adding a comment here.

Originally posted by @jzabroski in microsoft/azure-pipelines-tasks#17552 (comment)

Hi @jzabroski thank you for reporting. Your issue seems unrelated to the YAML itself, so I suggest that you open a ticket on Developer community

Can you tell me how you determined that? It seems clearly a bug to me, not a community issue. I may have the wrong github repo but there are several and it's confusing

Generally, issues for ADO are tracked on Dev Community (it is mentioned in this repo's README file), unless your issue is related to a more specific area for which a separate repository exists, such as pipeline agent, tasks, yaml templates, etc.