Search code examples
azure-devopsazure-pipelinespipeline

Azure DevOps "Required template check" not working


I am extending a template through repository resource in a yml pipeline (mainpipeline.yml), all working fine. project’s, repo folder structure details below.

My template is in OrgA -> proj1 -> repoX -> branch -> templates/set1/template1.yml (only one stage in this template with one job and 3 tasks)

My main pipeline is in OrgA -> proj2 -> repoY ->branch -> pipelines/mainpipeline.yml

Created service connection sc1 in OrgA -> proj2 to invoke templates from OrgA -> proj1 -> repoX

But the issue is, added required template check to enforce “mainpipeline.yml” extends “template1.yml" with help of steps provided by Microsoft documentation. check not working, it’s not restricting main pipeline to invoke other then the one added in the check, there is no pass or fail info.


Solution

  • I solved this issue by adding step "- checkout: repository" in template. Now, the the "Required template" check added to the service connection working fine, stopping main pipeline to invoke other then allowed templates.