Skip to content

Commit 5d13af5

Browse files
authored
Fix failing "Update BC Artifact Version" job when BCPlatform is untracked (#9022)
The scheduled `[releases/26.4] Update BC Artifact Version` job fails because the `UpdatePlatformVersion` automation calls `Update-PackageVersion -PackageName "BCPlatform"`, which throws `Package BCPlatform not found in Packages config`. Release branches like `releases/26.4` don't track a `BCPlatform` entry in `build/Packages.json`, so the automation errors and fails the whole job. ### Changes - **`.github/actions/RunAutomation/UpdatePlatformVersion/run.ps1`**: guard `Update-PackageVersion` with an existence check on the `BCPlatform` package. When it's absent, log and return "No update available" instead of throwing. Behavior is unchanged on branches that track the package. ```powershell $platformPackage = Get-ConfigValue -Key "BCPlatform" -ConfigType Packages if (-not $platformPackage) { Write-Host "BCPlatform package is not present in the Packages config. Skipping update." return $result } $newVersion = Update-PackageVersion -PackageName "BCPlatform" ``` [AB#612711](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/612711) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent d7e1723 commit 5d13af5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • .github/actions/RunAutomation/UpdatePlatformVersion

.github/actions/RunAutomation/UpdatePlatformVersion/run.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ param (
66

77
Import-Module $PSScriptRoot\..\..\..\..\build\scripts\EnlistmentHelperFunctions.psm1
88

9-
$newVersion = Update-PackageVersion -PackageName "BCPlatform"
10-
119
$result = @{
1210
'Files' = @()
1311
'Message' = "No update available"
1412
}
1513

14+
# Defensively check whether the BCPlatform package is tracked in the Packages config.
15+
# Some (older) release branches do not track the BCPlatform package, in which case there is nothing to update.
16+
$platformPackage = Get-ConfigValue -Key "BCPlatform" -ConfigType Packages
17+
if (-not $platformPackage) {
18+
Write-Host "BCPlatform package is not present in the Packages config. Skipping update."
19+
return $result
20+
}
21+
22+
$newVersion = Update-PackageVersion -PackageName "BCPlatform"
23+
1624
if ($newVersion) {
1725
$result.Files = @(Get-PackagesFilePath -Relative)
1826
$result.Message = "Update platform version. New value: $newVersion"

0 commit comments

Comments
 (0)