0
votes

I have a publish task in Azure Devops pipeline which should publish an excel file with extension .xlsx . am using this below command but its not working. can someone help me with the wildcards? this excel file is dynamic and date,month parameters keeps on changing.

format: SonarQube Issue Extract_2020-08-04.xlsx

task: PublishBuildArtifacts@1 inputs: PathtoPublish: 'C:\Users\320066547\agent_work\3\s\SonarFetchIssues\target*.xlsx' ArtifactName: 'IssuesOutput' publishLocation: 'Container'

2
can you post the YAML fileSajeetharan
Could you also post the associated error/log please ?Thomas
##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: C:\Users\320066547\agent_work\3\s\SonarFetchIssues\target*.xlsxpriya
I have posted the YAML publish task abovepriya
What about making sure the excel is in a dedicated sub(directory) and then publish the entire directory, instead of using a filename?Bernard Vander Beken

2 Answers

0
votes

If using a YAML pipeline look at using the PublishPipelineArtifact task

  - task: PublishPipelineArtifact@1
    displayName: 'Publish Artifact: drop'
    inputs:
       artifact: drop
       targetPath: $(Build.ArtifactStagingDirectory)

This will publish all the artifacts in the pipeline. From there can narrow down the exact path that is being published.

Alternatively too can do run a Powershell task before your publish to see exactly what your folder structure looks like on the agent:

-powershell: Get-ChildItem -Path 'Insert root path' -recurse
0
votes

This is clearly stated in the task:

Path to publish: The folder or file path to publish. This can be a fully-qualified path or a path relative to the root of the repository. Wildcards are not supported. Variables are supported. Example: $(Build.ArtifactStagingDirectory)

enter image description here