microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 924 forks source link

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

Closed jzabroski closed 4 months ago

jzabroski commented 4 months ago

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 https://github.com/microsoft/azure-pipelines-tasks/issues/17552#issuecomment-1934397090

aleksandrlevochkin commented 4 months ago

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

jzabroski commented 4 months ago

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

aleksandrlevochkin commented 4 months ago

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.