From 5a234460c28169bf204e3f2f2592010278b4f323 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:08:25 +0000 Subject: [PATCH 01/26] Add GitHub Actions workflow for package updates --- .github/workflows/package-update.yml | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/package-update.yml diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml new file mode 100644 index 000000000..2463f4695 --- /dev/null +++ b/.github/workflows/package-update.yml @@ -0,0 +1,64 @@ +name: Package Updates (GitHub) + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - scripts/**.ps1 # adjust as you like + +permissions: + contents: write + pull-requests: write + +jobs: + run-script-and-pr: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: true + fetch-depth: 0 + + - name: Install GitHub CLI + uses: cli/cli-action@v2 + with: + version: 'latest' + + - name: Run PowerShell script + shell: pwsh + run: | + ./scripts/Update-Stuff.ps1 -Verbose + + - name: Create branch, commit, push + shell: pwsh + run: | + $branch = "automation/package-update-${{ github.run_id }}" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git checkout -b $branch + git add -A + + if (git diff --cached --quiet) { + echo "No changes detected; exiting." + exit 0 + } + + git commit -m "chore(automation): apply PowerShell updates" + git push --set-upstream origin $branch + + - name: Open PR with gh + if: success() + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr create ` + --title "Automated Package Update" ` + --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` + --base main ` + --head "automation/ps-update-${{ github.run_id }}" ` + --label automation --label powershell ` + --assignee "${{ github.actor }}" From b7f8e531187de2dc82d3aa9eebf10b35e930aef9 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:09:49 +0000 Subject: [PATCH 02/26] Add script to update NuGet package versions This script updates NuGet package versions in the Directory.Packages.props file by querying the latest available versions and updating the Version attributes accordingly, while respecting the PreserveMajor attribute and pre-release version detection. --- .../scripts/Update-NuGetPackageVersions.ps1 | 309 ++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 .github/scripts/Update-NuGetPackageVersions.ps1 diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 new file mode 100644 index 000000000..2b52cd302 --- /dev/null +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -0,0 +1,309 @@ +<# +.SYNOPSIS + Updates NuGet package versions in Directory.Packages.props file. + +.DESCRIPTION + Scans Directory.Packages.props for PackageVersion elements in ItemGroups labeled 'AutoUpdate', + queries the latest available versions using 'dotnet package search', and updates the Version + attributes accordingly. Respects PreserveMajor attribute and pre-release version detection. + +.PARAMETER PropsFilePath + Relative path to the Directory.Packages.props file from the source directory. + Default: "Directory.Packages.props" + +.PARAMETER SourcesDirectory + The root source directory containing the props file. + Default: $env:BUILD_SOURCESDIRECTORY (Azure Pipelines variable) + +.PARAMETER FailOnError + If $true, throws an exception on package lookup failures. If $false, logs warnings and continues. + Default: $false + +.NOTES + Verbose logging is automatically enabled when Azure Pipelines System.Debug is set to 'true'. + To enable verbose logging, set the system.debug variable in your pipeline or run with: + variables: + system.debug: true + +.EXAMPLE + .\Update-NuGetPackageVersions.ps1 + +.EXAMPLE + .\Update-NuGetPackageVersions.ps1 -PropsFilePath "Directory.Packages.props" -FailOnError $true + +.EXAMPLE + $env:SYSTEM_DEBUG = 'true'; .\Update-NuGetPackageVersions.ps1 +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $false)] + [string]$PropsFilePath = "Directory.Packages.props", + + [Parameter(Mandatory = $false)] + [string]$SourcesDirectory = $env:BUILD_SOURCESDIRECTORY, + + [Parameter(Mandatory = $false)] + [bool]$FailOnError = $false +) + +# Auto-detect verbose logging from Azure Pipelines System.Debug variable +$EnableVerboseLogging = ($env:SYSTEM_DEBUG -eq 'true') -or ($env:SYSTEM_DEBUG -eq '1') + +$ErrorActionPreference = if ($FailOnError) { "Stop" } else { "Continue" } + +# Helper function for version comparison (from VersionUtils.ps1) +function Get-LatestVersionFromString { + param ( + [string]$First, + [string]$Second + ) + + if (-not $First) { return $Second } + if (-not $Second) { return $First } + + function Get-VersionFromString { + param ([string]$Value) + + $splitIndex = $Value.IndexOf('-') + if ($splitIndex -eq -1) { + $versionString = $Value + $suffix = '' + } else { + $versionString = $Value.Substring(0, $splitIndex) + $suffix = $Value.Substring($splitIndex) + } + + $version = $null + if (-not [System.Version]::TryParse($versionString, [ref]$version)) { + $version = $versionString + } + + return [PSCustomObject]@{ Version = $version; Suffix = $suffix } + } + + $firstVersionObject = Get-VersionFromString $First + $secondVersionObject = Get-VersionFromString $Second + + if ($firstVersionObject.Version -eq $secondVersionObject.Version) { + if (-not $firstVersionObject.Suffix) { return $First } + if (-not $secondVersionObject.Suffix) { return $Second } + if ($firstVersionObject.Suffix -lt $secondVersionObject.Suffix) { return $Second } + return $First + } + + if ($firstVersionObject.Version -lt $secondVersionObject.Version) { return $Second } + return $First +} + +function Test-PreReleaseVersion { + param ([string]$Version) + return $Version.Contains('-') +} + +function Get-LatestPackageVersion { + param ( + [string]$PackageId, + [bool]$IncludePrerelease, + [string]$MajorVersion = "" + ) + + try { + $prereleaseFlag = if ($IncludePrerelease) { "--prerelease" } else { "" } + + # Check if NuGet.config exists in the sources directory + $nugetConfigPath = Join-Path $SourcesDirectory "NuGet.config" + $configSourceFlag = "" + if (Test-Path $nugetConfigPath) { + $configSourceFlag = "--configfile `"$nugetConfigPath`"" + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Using NuGet.config from: $nugetConfigPath" + } + } else { + Write-Warning "NuGet.config not found at: $SourcesDirectory - search may not find private feeds" + } + + $searchCmd = "dotnet package search `"$PackageId`" --exact-match --format json $prereleaseFlag $configSourceFlag" + + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Executing: $searchCmd" + } + + Write-Host "Searching for package: $PackageId $(if ($MajorVersion) { "(major version $MajorVersion.*)" })" + + $output = Invoke-Expression $searchCmd 2>&1 | Out-String + + if ($LASTEXITCODE -ne 0) { + $errorMsg = "Failed to search for package '$PackageId': $output" + if ($FailOnError) { + throw $errorMsg + } else { + Write-Warning $errorMsg + return $null + } + } + + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Raw output: $output" + } + + $result = $output | ConvertFrom-Json + + if (-not $result.searchResult -or $result.searchResult.Count -eq 0) { + $errorMsg = "Package '$PackageId' not found in any configured feed" + if ($FailOnError) { + throw $errorMsg + } else { + Write-Warning $errorMsg + return $null + } + } + + # Iterate through all sources and packages to find the latest version + # The JSON structure is: searchResult[].packages[].version + $latestVersion = $null + foreach ($source in $result.searchResult) { + if ($source.packages) { + foreach ($package in $source.packages) { + if ($package.id -eq $PackageId) { + # If major version filtering is needed, skip non-matching versions + if ($MajorVersion -and -not ($package.version -match "^$MajorVersion\.")) { + continue + } + $latestVersion = Get-LatestVersionFromString -First $latestVersion -Second $package.version + } + } + } + } + + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Found latest version: $latestVersion" + } + + return $latestVersion + } + catch { + $errorMsg = "Error searching for package '$PackageId': $_" + if ($FailOnError) { + throw $errorMsg + } else { + Write-Warning $errorMsg + return $null + } + } +} + +# Main script execution +Write-Host "===============================================================================" +Write-Host "NuGet Package Version Update Script" +Write-Host "===============================================================================" +Write-Host "Props File Path: $PropsFilePath" +Write-Host "Sources Directory: $SourcesDirectory" +Write-Host "Verbose Logging: $EnableVerboseLogging" +Write-Host "Fail On Error: $FailOnError" +Write-Host "===============================================================================" + +$propsFile = Join-Path $SourcesDirectory $PropsFilePath +Write-Host "Full path to props file: $propsFile" + +if (-not (Test-Path $propsFile)) { + $errorMsg = "Props file not found at: $propsFile" + if ($FailOnError) { + throw $errorMsg + } else { + Write-Warning $errorMsg + exit 1 + } +} + +Write-Host "Updating NuGet packages in: $propsFile" + +# Load XML with whitespace preservation +$xml = New-Object System.Xml.XmlDocument +$xml.PreserveWhitespace = $true +$xml.Load($propsFile) + +$updateCount = 0 + +# Find all ItemGroups with AutoUpdate label +$autoUpdateGroups = $xml.Project.ItemGroup | Where-Object { + $null -ne $_.Label -and $_.Label -match 'AutoUpdate' +} + +Write-Host "Found $($autoUpdateGroups.Count) ItemGroups with AutoUpdate label" + +foreach ($itemGroup in $autoUpdateGroups) { + $packageVersions = $itemGroup.PackageVersion + + if (-not $packageVersions) { continue } + + if ($EnableVerboseLogging) { + Write-Host "[VERBOSE] Processing ItemGroup with $(@($packageVersions).Count) packages" + } + + foreach ($packageVersion in $packageVersions) { + $packageId = $packageVersion.Include + $currentVersion = $packageVersion.Version + $preserveMajor = $packageVersion.PreserveMajor -eq "true" + + if (-not $packageId -or -not $currentVersion) { + Write-Host "Skipping invalid PackageVersion: $($packageVersion.OuterXml)" + continue + } + + if ($EnableVerboseLogging) { + Write-Host "[VERBOSE] Processing: $packageId (current: $currentVersion, preserveMajor: $preserveMajor)" + } + + # Determine if we should include prerelease + $includePrerelease = Test-PreReleaseVersion -Version $currentVersion + + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Include prerelease: $includePrerelease" + } + + # Get major version if needed + $majorVersion = "" + if ($preserveMajor) { + $majorVersion = $currentVersion.Split('.')[0] + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Preserving major version: $majorVersion" + } + } + + # Get latest version + $latestVersion = Get-LatestPackageVersion -PackageId $packageId -IncludePrerelease $includePrerelease -MajorVersion $majorVersion + + if (-not $latestVersion) { + Write-Host "No update available for '$packageId'" + continue + } + + # Compare versions + $selectedVersion = Get-LatestVersionFromString -First $currentVersion -Second $latestVersion + + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Version comparison: current=$currentVersion, latest=$latestVersion, selected=$selectedVersion" + } + + if ($selectedVersion -ne $currentVersion) { + Write-Host "##[section]Updating '$packageId' from '$currentVersion' to '$latestVersion'" + $packageVersion.Version = $latestVersion + $updateCount++ + } else { + Write-Host "Package '$packageId' already at latest version '$currentVersion'" + } + } +} + +if ($updateCount -gt 0) { + Write-Host "##[section]Saving $updateCount package updates to $propsFile" + $xml.Save($propsFile) + Write-Host "Successfully updated $updateCount packages" +} else { + Write-Host "No package updates needed" +} + +Write-Host "===============================================================================" +Write-Host "NuGet Package Update Complete" +Write-Host "===============================================================================" From c0d9eb7a2ff89bb161020d9c205ecd4eb8eea0f2 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:10:39 +0000 Subject: [PATCH 03/26] Update script paths in package-update.yml --- .github/workflows/package-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 2463f4695..736b16bf3 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -6,7 +6,7 @@ on: branches: - main paths: - - scripts/**.ps1 # adjust as you like + - .github/scripts/**.ps1 # adjust as you like permissions: contents: write @@ -30,7 +30,7 @@ jobs: - name: Run PowerShell script shell: pwsh run: | - ./scripts/Update-Stuff.ps1 -Verbose + ./.github/scripts/Update-NuGetPackageVersions.ps1 -Verbose - name: Create branch, commit, push shell: pwsh From bfb26c876e2a24b1fa42ee71fdad7ed7006b683d Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:12:30 +0000 Subject: [PATCH 04/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/package-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 736b16bf3..17d402ac9 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -59,6 +59,6 @@ jobs: --title "Automated Package Update" ` --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` --base main ` - --head "automation/ps-update-${{ github.run_id }}" ` + --head "automation/package-update-${{ github.run_id }}" ` --label automation --label powershell ` --assignee "${{ github.actor }}" From 88eb82cb9b4b9a14a06946cc62b3660dcdbd88db Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:13:41 +0000 Subject: [PATCH 05/26] Update package-update workflow to use cron schedule Changed the trigger for package updates to a scheduled cron job. --- .github/workflows/package-update.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 17d402ac9..a6efd3070 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -1,12 +1,8 @@ name: Package Updates (GitHub) on: - workflow_dispatch: - push: - branches: - - main - paths: - - .github/scripts/**.ps1 # adjust as you like + schedule: + - cron: "0 6 * * 1" permissions: contents: write From 671dd9748fc3bc7bf9ffe10aeb6cdfece5717582 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:24:19 +0000 Subject: [PATCH 06/26] Update .github/scripts/Update-NuGetPackageVersions.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/scripts/Update-NuGetPackageVersions.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index 2b52cd302..0a585e2dc 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -47,9 +47,15 @@ param( [bool]$FailOnError = $false ) -# Auto-detect verbose logging from Azure Pipelines System.Debug variable -$EnableVerboseLogging = ($env:SYSTEM_DEBUG -eq 'true') -or ($env:SYSTEM_DEBUG -eq '1') +# Determine whether verbose logging should be enabled: +# - Prefer the standard -Verbose common parameter when explicitly passed +# - Fall back to Azure Pipelines System.Debug variable for backwards compatibility +$isVerboseParameterSet = $PSBoundParameters.ContainsKey('Verbose') -and $PSBoundParameters['Verbose'] +$EnableVerboseLogging = $isVerboseParameterSet -or ($env:SYSTEM_DEBUG -eq 'true') -or ($env:SYSTEM_DEBUG -eq '1') +if ($EnableVerboseLogging) { + $VerbosePreference = 'Continue' +} $ErrorActionPreference = if ($FailOnError) { "Stop" } else { "Continue" } # Helper function for version comparison (from VersionUtils.ps1) From 1c56edc08a944f316ceb0e9f3f673ae4b009826d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:28:44 +0000 Subject: [PATCH 07/26] Gate PR creation on commit detection in package-update workflow (#796) * Initial plan * Gate PR creation on changes detection flag Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com> --- .github/workflows/package-update.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index a6efd3070..6a2ee9863 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -29,6 +29,7 @@ jobs: ./.github/scripts/Update-NuGetPackageVersions.ps1 -Verbose - name: Create branch, commit, push + id: commit shell: pwsh run: | $branch = "automation/package-update-${{ github.run_id }}" @@ -39,15 +40,17 @@ jobs: git add -A if (git diff --cached --quiet) { - echo "No changes detected; exiting." + echo "No changes detected; skipping commit and PR creation." + echo "has-changes=false" >> $env:GITHUB_OUTPUT exit 0 } git commit -m "chore(automation): apply PowerShell updates" git push --set-upstream origin $branch + echo "has-changes=true" >> $env:GITHUB_OUTPUT - name: Open PR with gh - if: success() + if: steps.commit.outputs.has-changes == 'true' env: GH_TOKEN: ${{ github.token }} run: | From 4b27d313796b4b59b7ef83569a3a5528eb745780 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 14:37:47 +0000 Subject: [PATCH 08/26] Update .github/scripts/Update-NuGetPackageVersions.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/scripts/Update-NuGetPackageVersions.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index 0a585e2dc..4acca699c 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -47,6 +47,23 @@ param( [bool]$FailOnError = $false ) +# Normalize and validate SourcesDirectory so it is always a valid root directory +if ([string]::IsNullOrWhiteSpace($SourcesDirectory)) { + # GitHub Actions default + $SourcesDirectory = $env:GITHUB_WORKSPACE +} + +if ([string]::IsNullOrWhiteSpace($SourcesDirectory)) { + # Local or generic PowerShell fallback + $SourcesDirectory = (Get-Location).Path +} + +if (-not (Test-Path -LiteralPath $SourcesDirectory -PathType Container)) { + throw "SourcesDirectory '$SourcesDirectory' does not exist or is not a directory. Specify a valid -SourcesDirectory path." +} + +# Resolve to a fully qualified, normalized path +$SourcesDirectory = (Resolve-Path -LiteralPath $SourcesDirectory).ProviderPath # Determine whether verbose logging should be enabled: # - Prefer the standard -Verbose common parameter when explicitly passed # - Fall back to Azure Pipelines System.Debug variable for backwards compatibility From 8c3190ac0f24025ca4b3b895247ce03f471646ad Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:29:40 +0000 Subject: [PATCH 09/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/scripts/Update-NuGetPackageVersions.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index 4acca699c..39c0c0891 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -41,7 +41,17 @@ param( [string]$PropsFilePath = "Directory.Packages.props", [Parameter(Mandatory = $false)] - [string]$SourcesDirectory = $env:BUILD_SOURCESDIRECTORY, + [string]$SourcesDirectory = $( + if ($env:BUILD_SOURCESDIRECTORY) { + $env:BUILD_SOURCESDIRECTORY + } + elseif ($env:GITHUB_WORKSPACE) { + $env:GITHUB_WORKSPACE + } + else { + (Get-Location).Path + } + ), [Parameter(Mandatory = $false)] [bool]$FailOnError = $false From 287fbe0a22351a925f5bbf6842fe734bb213d790 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:30:36 +0000 Subject: [PATCH 10/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/scripts/Update-NuGetPackageVersions.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index 39c0c0891..b3988d82c 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -144,16 +144,24 @@ function Get-LatestPackageVersion { try { $prereleaseFlag = if ($IncludePrerelease) { "--prerelease" } else { "" } - # Check if NuGet.config exists in the sources directory + # Prefer NuGet-GitHub.Config (used on GitHub runners) when present, otherwise fall back to NuGet.config + $nugetGithubConfigPath = Join-Path $SourcesDirectory "NuGet-GitHub.Config" $nugetConfigPath = Join-Path $SourcesDirectory "NuGet.config" $configSourceFlag = "" - if (Test-Path $nugetConfigPath) { + if (Test-Path $nugetGithubConfigPath) { + $configSourceFlag = "--configfile `"$nugetGithubConfigPath`"" + if ($EnableVerboseLogging) { + Write-Host " [VERBOSE] Using NuGet-GitHub.Config from: $nugetGithubConfigPath" + } + } + elseif (Test-Path $nugetConfigPath) { $configSourceFlag = "--configfile `"$nugetConfigPath`"" if ($EnableVerboseLogging) { Write-Host " [VERBOSE] Using NuGet.config from: $nugetConfigPath" } - } else { - Write-Warning "NuGet.config not found at: $SourcesDirectory - search may not find private feeds" + } + else { + Write-Warning "NuGet-GitHub.Config or NuGet.config not found at: $SourcesDirectory - search may not find required feeds" } $searchCmd = "dotnet package search `"$PackageId`" --exact-match --format json $prereleaseFlag $configSourceFlag" From c56db37d30ef8b5e7967612de5e1a77859c2ce76 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:31:03 +0000 Subject: [PATCH 11/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/scripts/Update-NuGetPackageVersions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index b3988d82c..17706c4ac 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -170,7 +170,7 @@ function Get-LatestPackageVersion { Write-Host " [VERBOSE] Executing: $searchCmd" } - Write-Host "Searching for package: $PackageId $(if ($MajorVersion) { "(major version $MajorVersion.*)" })" + Write-Host ("Searching for package: {0} {1}" -f $PackageId, (if ($MajorVersion) { "(major version {0}.*)" -f $MajorVersion } else { "" })) $output = Invoke-Expression $searchCmd 2>&1 | Out-String From 1a0292981a91a2e4afb8591cfa4ce801c5336f30 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:35:26 +0000 Subject: [PATCH 12/26] Add pull_request_target trigger to workflow --- .github/workflows/package-update.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 6a2ee9863..8a4c9a372 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -3,6 +3,9 @@ name: Package Updates (GitHub) on: schedule: - cron: "0 6 * * 1" + pull_request_target: + branches: + - main permissions: contents: write From 1cf02c933088d9795108e2a3fc496a3aa81c5ecb Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:38:55 +0000 Subject: [PATCH 13/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/package-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 8a4c9a372..63443301f 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -16,7 +16,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: persist-credentials: true fetch-depth: 0 From 331b09d49e77b4f636eb7591d54e0dca8cf2b72e Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:41:15 +0000 Subject: [PATCH 14/26] Update package-update.yml --- .github/workflows/package-update.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 63443301f..f22469499 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -26,6 +26,11 @@ jobs: with: version: 'latest' + - name: Install .NET 10 SDK + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' + - name: Run PowerShell script shell: pwsh run: | From 07d2d477f1f24a3ed10643007c99897538feec67 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:59:27 +0000 Subject: [PATCH 15/26] Update package-update.yml --- .github/workflows/package-update.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index f22469499..c5ba74d59 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -3,9 +3,8 @@ name: Package Updates (GitHub) on: schedule: - cron: "0 6 * * 1" - pull_request_target: - branches: - - main + pull_request: + branches: [ "main" ] permissions: contents: write From 0455764e73edfcde5947976c0d0076287d9312bb Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 20:02:16 +0000 Subject: [PATCH 16/26] Rename checkout step for clarity --- .github/workflows/package-update.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index c5ba74d59..0b36b7f51 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -14,10 +14,9 @@ jobs: run-script-and-pr: runs-on: windows-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v6 with: - persist-credentials: true fetch-depth: 0 - name: Install GitHub CLI From 1cbd892c186faf90dd78a7d260022cc2b96fd719 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 20:03:59 +0000 Subject: [PATCH 17/26] Remove GitHub CLI installation from package-update.yml Removed GitHub CLI installation step from workflow. --- .github/workflows/package-update.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 0b36b7f51..875aeaac9 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -19,11 +19,6 @@ jobs: with: fetch-depth: 0 - - name: Install GitHub CLI - uses: cli/cli-action@v2 - with: - version: 'latest' - - name: Install .NET 10 SDK uses: actions/setup-dotnet@v5 with: From 3e9278101f26748c7ef2f4f5e4aa1ab21c7f5519 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:16:36 +0000 Subject: [PATCH 18/26] Update Update-NuGetPackageVersions.ps1 --- .github/scripts/Update-NuGetPackageVersions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/Update-NuGetPackageVersions.ps1 b/.github/scripts/Update-NuGetPackageVersions.ps1 index 17706c4ac..491c8f93d 100644 --- a/.github/scripts/Update-NuGetPackageVersions.ps1 +++ b/.github/scripts/Update-NuGetPackageVersions.ps1 @@ -170,7 +170,7 @@ function Get-LatestPackageVersion { Write-Host " [VERBOSE] Executing: $searchCmd" } - Write-Host ("Searching for package: {0} {1}" -f $PackageId, (if ($MajorVersion) { "(major version {0}.*)" -f $MajorVersion } else { "" })) + Write-Host ("Searching for package: {0} {1}" -f $PackageId, ($MajorVersion ? ('(major version {0}.*)' -f $MajorVersion) : '')) $output = Invoke-Expression $searchCmd 2>&1 | Out-String From fc9b6c76fb55fcab0407ae5a72fdc784ca8f29ab Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:22:23 +0000 Subject: [PATCH 19/26] Fix label assignment in package-update workflow --- .github/workflows/package-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 875aeaac9..5cb76f35a 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -60,5 +60,5 @@ jobs: --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` --base main ` --head "automation/package-update-${{ github.run_id }}" ` - --label automation --label powershell ` + --label powershell ` --assignee "${{ github.actor }}" From 527230e09c853a65e61e3b6ea5c5b7ab7d8df15e Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:23:50 +0000 Subject: [PATCH 20/26] Remove 'powershell' label from package update PR Removed the 'powershell' label from the automated package update PR. --- .github/workflows/package-update.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 5cb76f35a..4e168d0eb 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -60,5 +60,4 @@ jobs: --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` --base main ` --head "automation/package-update-${{ github.run_id }}" ` - --label powershell ` --assignee "${{ github.actor }}" From 34493b95f693619e3843fc52cce416b864f2cc62 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:25:09 +0000 Subject: [PATCH 21/26] Add label to automated package update PR --- .github/workflows/package-update.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 4e168d0eb..126af200c 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -60,4 +60,5 @@ jobs: --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` --base main ` --head "automation/package-update-${{ github.run_id }}" ` + --label automation --assignee "${{ github.actor }}" From f2afff8ee19b95307e9e2d1afd8787b097f6e69d Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:27:23 +0000 Subject: [PATCH 22/26] Fix label formatting in package-update.yml --- .github/workflows/package-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 126af200c..ca35abdd4 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -60,5 +60,5 @@ jobs: --body "This PR was created automatically by the workflow run ${{ github.run_id }}." ` --base main ` --head "automation/package-update-${{ github.run_id }}" ` - --label automation + --label automation ` --assignee "${{ github.actor }}" From f5431d84ce9f215f9371ec194c15b0a3cdee59cf Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:15:10 +0000 Subject: [PATCH 23/26] Add token input for create pull request action --- .github/workflows/package-update.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index ca35abdd4..419a764b7 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -62,3 +62,5 @@ jobs: --head "automation/package-update-${{ github.run_id }}" ` --label automation ` --assignee "${{ github.actor }}" + with: + token: ${{secrets.CREATE_PULLREQUEST}} From cd5081db9c2b35bc3bcdb32cf04449d8e37f1576 Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:16:39 +0000 Subject: [PATCH 24/26] Update GH_TOKEN to use secrets for PR creation --- .github/workflows/package-update.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index 419a764b7..a91c8c5a0 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -53,7 +53,7 @@ jobs: - name: Open PR with gh if: steps.commit.outputs.has-changes == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.CREATE_PULLREQUEST }} run: | gh pr create ` --title "Automated Package Update" ` @@ -62,5 +62,3 @@ jobs: --head "automation/package-update-${{ github.run_id }}" ` --label automation ` --assignee "${{ github.actor }}" - with: - token: ${{secrets.CREATE_PULLREQUEST}} From 852325b05f01c52e46146df66f5ff51cbc6e3dba Mon Sep 17 00:00:00 2001 From: Neil <49037171+neilr81@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:26:49 +0000 Subject: [PATCH 25/26] Update package-update.yml --- .github/workflows/package-update.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/package-update.yml b/.github/workflows/package-update.yml index a91c8c5a0..5ce7ef256 100644 --- a/.github/workflows/package-update.yml +++ b/.github/workflows/package-update.yml @@ -54,6 +54,7 @@ jobs: if: steps.commit.outputs.has-changes == 'true' env: GH_TOKEN: ${{ secrets.CREATE_PULLREQUEST }} + shell: pwsh run: | gh pr create ` --title "Automated Package Update" ` From 379cba4898327542c90f9628dcad07929844ea34 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:27:52 +0000 Subject: [PATCH 26/26] chore(automation): apply PowerShell updates --- Directory.Packages.props | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d869372b4..070aaf357 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,59 +1,59 @@ - + true true - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + - - + + - + @@ -67,7 +67,7 @@ - +