Make sure we do not upload artifacts during a pull request (#7535)

This commit is contained in:
Travis Plunk 2018-08-16 13:11:24 -07:00 committed by GitHub
parent 4acf1038a1
commit 0a1a47e8b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -1331,7 +1331,11 @@ function Publish-TestResults
{
$resolvedPath = (Resolve-Path -Path $Path).ProviderPath
Write-Host "##vso[results.publish type=$Type;mergeResults=true;runTitle=$Title;publishRunAttachments=true;resultFiles=$resolvedPath;]"
Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$resolvedPath"
if($env:BUILD_REASON -ne 'PullRequest')
{
Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$resolvedPath"
}
}
}

View file

@ -233,8 +233,11 @@ function Send-VstsLogFile {
Copy-Item -Path $Path -Destination $logFile
}
Write-Host "##vso[artifact.upload containerfolder=$name;artifactname=$name]$logFile"
Write-Verbose "Log file captured as $name" -Verbose
if($env:BUILD_REASON -ne 'PullRequest')
{
Write-Host "##vso[artifact.upload containerfolder=$name;artifactname=$name]$logFile"
Write-Verbose "Log file captured as $name" -Verbose
}
}
# Tests if the Linux or macOS user is root