Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,10 @@ function GetModifiedSettingsContent {
$dstSettings | Add-Member -MemberType NoteProperty -Name "$schemaKey" -Value $schemaValue -Force

# Make sure the $schema property is the first property in the object
$dstSettings = $dstSettings | Select-Object @{ Name = '$schema'; Expression = { $_.'$schema' } }, * -ExcludeProperty '$schema'
# PS5-safe: explicitly list properties instead of using wildcard to avoid literal '*' being added
$otherProperties = @($dstSettings.PSObject.Properties.Name | Where-Object { $_ -ne $schemaKey })
$selectProperties = @($schemaKey) + $otherProperties
$dstSettings = $dstSettings | Select-Object -Property $selectProperties
}
}

Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The `DownloadProjectDependencies` action now downloads only artifacts from depen
### Issues

- Issue 2277 Auto-exclude the `copilot` GitHub environment from CI/CD deployments. When the GitHub Copilot coding agent is enabled on a repository, GitHub auto-creates an environment named `copilot`. AL-Go now treats it the same way as `github-pages` and never attempts to deploy to it.
- Issue 2285 - CheckForUpdates now handles settings file `$schema` reordering in a PowerShell 5-safe way to avoid writing invalid entries like `"*": null` to settings JSON files.
- Issue 2236 - `GetDependencies` `buildMode` prefix leaks across dependency iterations, causing incorrect artifact mask names when multiple `appDependencyProbingPaths` entries use different build modes
- Incremental builds (`modifiedApps` mode) now correctly identify unmodified apps for projects whose `appFolders` reference paths outside the project directory (e.g. using `../`)
- Issue 2204 - Workspace compilation ignores vsixFile setting
Expand Down
15 changes: 15 additions & 0 deletions Tests/CheckForUpdates.Action.Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@ Describe "CheckForUpdates Action: CheckForUpdates.HelperFunctions.ps1" {
$modifiedContent."srcSetting" | Should -Be "value1"
$modifiedContent."`$schema" | Should -Be "someSchema"
}

It 'GetModifiedSettingsContent does not create a literal * property when destination only contains $schema' {
# Repro for PS5 behavior where Select-Object with wildcard can emit "*": null
@{ "`$schema" = "sourceSchema"; "srcSetting" = "value1" } | ConvertTo-Json -Depth 10 | Out-File -FilePath $tmpSrcFile -Force
@{ "`$schema" = "destinationSchema" } | ConvertTo-Json -Depth 10 | Out-File -FilePath $tmpDstFile -Force

$modifiedContentJson = GetModifiedSettingsContent -srcSettingsFile $tmpSrcFile -dstSettingsFile $tmpDstFile
$modifiedContent = $modifiedContentJson | ConvertFrom-Json

$modifiedContent | Should -Not -BeNullOrEmpty
@($modifiedContent.PSObject.Properties.Name) | Should -Not -Contain '*'
$modifiedContentJson | Should -Not -Match '"\*"\s*:'
@($modifiedContent.PSObject.Properties.Name).Count | Should -Be 1
$modifiedContent."`$schema" | Should -Be "sourceSchema"
}
}

Describe "CheckForUpdates Action: ApplyWorkflowDefaultInputs Tests" {
Expand Down
Loading