Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps YAML Template Powershell script file issue #602

Closed
ashirulkar opened this issue Sep 29, 2023 · 2 comments
Closed

Azure DevOps YAML Template Powershell script file issue #602

ashirulkar opened this issue Sep 29, 2023 · 2 comments

Comments

@ashirulkar
Copy link

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

  • task: PowerShell@2
    inputs:
    scriptType: filePath
    filePath: "./script/Test.ps1"
    displayName: "Create slicing filter condition"

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
Copy link

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants