Skip to content

Commit 7b6026c

Browse files
committed
Skip UploadArtifacts task in PR builds, only upload from develop branch
1 parent 8ffa087 commit 7b6026c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vscode-powershell.build.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ param(
99

1010
#Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.0.0"}
1111

12+
$script:IsPullRequestBuild =
13+
$env:APPVEYOR_PULL_REQUEST_NUMBER -and
14+
$env:APPVEYOR_REPO_BRANCH -eq "develop"
15+
1216
task GetExtensionVersion -Before Package {
17+
1318
$updateVersion = $false
1419
$script:ExtensionVersion = `
1520
if ($env:AppVeyor) {
@@ -28,6 +33,7 @@ task GetExtensionVersion -Before Package {
2833
}
2934

3035
task ResolveEditorServicesPath -Before Clean, Build {
36+
3137
$script:psesRepoPath = `
3238
if ($EditorServicesRepoPath) {
3339
$EditorServicesRepoPath
@@ -48,6 +54,7 @@ task ResolveEditorServicesPath -Before Clean, Build {
4854
}
4955

5056
task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } -Before Build {
57+
5158
Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green
5259

5360
# When in a CI build use the --loglevel=error parameter so that
@@ -57,6 +64,7 @@ task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") }
5764
}
5865

5966
task Clean {
67+
6068
if ($script:psesBuildScriptPath) {
6169
Write-Host "`n### Cleaning PowerShellEditorServices`n" -ForegroundColor Green
6270
Invoke-Build Clean $script:psesBuildScriptPath
@@ -89,7 +97,8 @@ task Package {
8997
exec { & node ./node_modules/vsce/out/vsce package }
9098
}
9199

92-
task UploadArtifacts -If { $env:AppVeyor } {
100+
task UploadArtifacts -If { $env:AppVeyor -and !$script:IsPullRequestBuild -and $env:APPVEYOR_REPO_BRANCH -eq "develop" } {
101+
93102
Push-AppveyorArtifact .\PowerShell-$($script:ExtensionVersion).vsix
94103
}
95104

0 commit comments

Comments
 (0)