Skip to content

Commit

Permalink
DeliverToAppSource bug found in end 2 end (#1219)
Browse files Browse the repository at this point in the history
Continuous Delivery To AppSource no longer worked

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
  • Loading branch information
freddydk and freddydk authored Sep 24, 2024
1 parent 8d7e66f commit c198d5f
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Actions/DetermineDeliveryTargets/DetermineDeliveryTargets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@

function ContinuousDelivery([string] $deliveryTarget) {
$settingsName = "DeliverTo$deliveryTarget"
if ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) {
if ($deliveryTarget -eq 'AppSource' -and $settings.type -eq "AppSource App") {
# For multi-project repositories, ContinuousDelivery can be set on the projects
foreach($project in ($projectsJson | ConvertFrom-Json)) {
$projectSettings = ReadSettings -project $project
if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) {
Write-Host "Project $project is setup for Continuous Delivery to AppSource"
return $true
}
}
return $false
}
elseif ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) {
return $settings."$settingsName".ContinuousDelivery
}
else {
Expand Down Expand Up @@ -44,14 +55,7 @@ function IncludeDeliveryTarget([string] $deliveryTarget) {
$settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable -recurse
$deliveryTargets = @('GitHubPackages','NuGet','Storage')
if ($settings.type -eq "AppSource App") {
# For multi-project repositories, we will add deliveryTarget AppSource if any project has AppSourceContinuousDelivery set to true
($projectsJson | ConvertFrom-Json) | ForEach-Object {
$projectSettings = ReadSettings -project $_
if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) {
Write-Host "Project $_ is setup for Continuous Delivery to AppSource"
$deliveryTargets += @("AppSource")
}
}
$deliveryTargets += @("AppSource")
}
# Include custom delivery targets
$namePrefix = 'DeliverTo'
Expand Down

0 comments on commit c198d5f

Please sign in to comment.