可以通过添加 checkLatest: true 参数来解决该问题,该参数将确保始终下载最新的artifact,即使前一个运行没有生成任何artifact。以下是示例代码:
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'MyArtifact'
itemType: 'file'
itemPattern: '**/*.zip'
downloadPath: '$(System.ArtifactsDirectory)'
failOnNotExist: false
checkLatest: true # add this line