Reputation: 445
I have a pipeline in Azure DevOps that gets an file, stores it in a folder named 'artifact' within a Github repo, and use that file in the Publish artifact task.
For some reason, it always fails on the auto-trigger, which is set up to trigger this pipeline after the completion of a previous one. But if I trigger it manually, it succeeds. It always fails with the below error.
Publishing build artifacts failed with an error: Not found PathtoPublish: /home/vsts/work/1/s/artifact/datasync1
Upvotes: 0
Views: 3107
Reputation: 76986
Publish Artifact task in Azure devops fails when auto-triggered but passes when queued manually
It is hard to give a precise answer because it's related to your actual project and build definition. Since you do not share much info about the build pipeline completion of a previous one, so we could not figure out the key points that are causing this issue.
I would like provide you some info to troubleshooting this issue, you can check if it helps you:
As we know, Publish Build Artifacts task is used to publish build artifacts to Azure Pipelines, TFS, or a file share in a build pipeline. And the argument Path to publish
:
Path to the folder or file you want to publish. The path must be a fully-qualified path or a valid path relative to the root directory of your repository.
According to the error messages "Not found PathtoPublish...", it seems the completion build of a previous one operate this folder, like, delete, clear. You can check the log if there any task to do this.
If you could not find any task to do this, you can create a new build pipeline with simple task in it, and set it as completion of a previous one, then check if this issue still occurred.
Hope this helps.
Upvotes: 1