Skip to content

Commit c198d5f

Browse files
authored
DeliverToAppSource bug found in end 2 end (microsoft#1219)
Continuous Delivery To AppSource no longer worked Co-authored-by: freddydk <[email protected]>
1 parent 8d7e66f commit c198d5f

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Actions/DetermineDeliveryTargets/DetermineDeliveryTargets.ps1

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@
77

88
function ContinuousDelivery([string] $deliveryTarget) {
99
$settingsName = "DeliverTo$deliveryTarget"
10-
if ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) {
10+
if ($deliveryTarget -eq 'AppSource' -and $settings.type -eq "AppSource App") {
11+
# For multi-project repositories, ContinuousDelivery can be set on the projects
12+
foreach($project in ($projectsJson | ConvertFrom-Json)) {
13+
$projectSettings = ReadSettings -project $project
14+
if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) {
15+
Write-Host "Project $project is setup for Continuous Delivery to AppSource"
16+
return $true
17+
}
18+
}
19+
return $false
20+
}
21+
elseif ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) {
1122
return $settings."$settingsName".ContinuousDelivery
1223
}
1324
else {
@@ -44,14 +55,7 @@ function IncludeDeliveryTarget([string] $deliveryTarget) {
4455
$settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable -recurse
4556
$deliveryTargets = @('GitHubPackages','NuGet','Storage')
4657
if ($settings.type -eq "AppSource App") {
47-
# For multi-project repositories, we will add deliveryTarget AppSource if any project has AppSourceContinuousDelivery set to true
48-
($projectsJson | ConvertFrom-Json) | ForEach-Object {
49-
$projectSettings = ReadSettings -project $_
50-
if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) {
51-
Write-Host "Project $_ is setup for Continuous Delivery to AppSource"
52-
$deliveryTargets += @("AppSource")
53-
}
54-
}
58+
$deliveryTargets += @("AppSource")
5559
}
5660
# Include custom delivery targets
5761
$namePrefix = 'DeliverTo'

0 commit comments

Comments
 (0)