Skip to content

Commit

Permalink
Update publish template
Browse files Browse the repository at this point in the history
Add logging and fix display name given Agent.JobStatus doesn't evaluate currently in the display name property.
  • Loading branch information
weshaggard authored and azure-sdk committed Jun 18, 2024
1 parent 3d1ea64 commit 81cc2d2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ parameters:
steps:
- pwsh: |
if ($env:AGENT_JOBSTATUS -eq "Failed") {
Write-Host "Setting artifact name to ${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt) because there were failures."
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)"
} else {
Write-Host "Setting artifact name to ${{ parameters.ArtifactName }}"
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}"
}
condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }})
displayName: Set Artifact Name $(Agent.JobStatus)
displayName: Set Artifact Name
- task: 1ES.PublishPipelineArtifact@1
condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }})
Expand Down

0 comments on commit 81cc2d2

Please sign in to comment.