Skip to content

Commit

Permalink
Make sure we do not upload artifacts during a pull request (PowerShel…
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 committed Aug 16, 2018
1 parent 4acf103 commit 0a1a47e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions test/tools/Modules/HelpersCommon/HelpersCommon.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a1a47e

Please sign in to comment.