diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index f83492a35f..f3d0ce0c1b 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -468,19 +468,22 @@ stages: targetType: inline workingDirectory: tests/Umbraco.Tests.AcceptanceTest script: 'npm run test --ignore-certificate-errors' - - bash: | - if [ -f $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ ]; then - echo "##vso[task.setVariable variable=myfileexists]true" - fi + - task: PowerShell@2 + displayName: Check if artifacts folder exists + inputs: + targetType: inline + script: | + $MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results + Write-Host "##vso[task.setvariable variable=resultFolderExists;]$MyVariable" - task: CopyFiles@2 displayName: Prepare artifacts - condition: eq(variables.myfileexists, 'true') + condition: eq(variables.resultFolderExists, 'True') inputs: sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/ targetFolder: $(Build.ArtifactStagingDirectory)/playwright - task: PublishPipelineArtifact@1 displayName: "Publish test artifacts" - condition: eq(variables.myfileexists, 'true') + condition: eq(variables.resultFolderExists, 'True') inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)'