microsoft / azure-pipelines-yaml

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

Azure DevOps YAML Template Powershell script file issue #602

Closed ashirulkar closed 7 months ago

ashirulkar commented 9 months ago

I have created a YAML template in Azure DevOps which can be used across repos to perform certain job. Part of YAML Template code:

This template resides in Repo1. It contains a folder script inside which Test.ps1 file is located. It works as expected when I use/refer this template inside some Azure pipelines in the same repo i.e. Repo1.

The issue occurs when I'm trying to refer this template in some other repo for e.g. Repo2. When I'm creating a new pipeline and refer this template it's failing at runtime as it's not able to find the powershell script file "./script/Test.ps1" referred in template.

I tried to checkout the Repo1 inside Azure pipeline created in Repo2 but it's not resolving the issue.

Please help to share some solution on this issue.

ivanduplenskikh commented 9 months ago

@ashirulkar, how do you get a script in the pipeline? There is documentation related to multi-repo checkout that can contain information that may help you. Did you checkout with the proper checkout task? Could you share the error output when you try to use a script?

ashirulkar commented 7 months ago

This is resolved by correcting code error when checking out Repo1 inside Repo2