Skip to content

Gate PR creation on commit detection in package-update workflow#796

Merged
neilr81 merged 2 commits intobugfix/add-pufrom
copilot/sub-pr-794
Feb 7, 2026
Merged

Gate PR creation on commit detection in package-update workflow#796
neilr81 merged 2 commits intobugfix/add-pufrom
copilot/sub-pr-794

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Addresses feedback from PR #794 where the workflow would fail when no package updates are available. The commit step exits successfully when git diff --cached --quiet is true, but the PR creation step still runs with if: success() and fails due to the missing remote branch.

Changes:

  • Add step output has-changes to propagate change detection state
  • Set has-changes=false when no staged changes detected, has-changes=true after successful push
  • Gate PR creation on steps.commit.outputs.has-changes == 'true' instead of success()
- name: Create branch, commit, push
  id: commit
  run: |
    if (git diff --cached --quiet) {
      echo "has-changes=false" >> $env:GITHUB_OUTPUT
      exit 0
    }
    git commit -m "..."
    git push ...
    echo "has-changes=true" >> $env:GITHUB_OUTPUT

- name: Open PR with gh
  if: steps.commit.outputs.has-changes == 'true'

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions workflow for package updates Gate PR creation on commit detection in package-update workflow Feb 7, 2026
Copilot AI requested a review from neilr81 February 7, 2026 14:25
@neilr81 neilr81 marked this pull request as ready for review February 7, 2026 14:28
@neilr81 neilr81 requested a review from a team as a code owner February 7, 2026 14:28
@neilr81 neilr81 merged commit 1c56edc into bugfix/add-pu Feb 7, 2026
1 check passed
@neilr81 neilr81 deleted the copilot/sub-pr-794 branch February 7, 2026 14:28
neilr81 added a commit that referenced this pull request Mar 4, 2026
* Add GitHub Actions workflow for package updates

* 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.

* Update script paths in package-update.yml

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update package-update workflow to use cron schedule

Changed the trigger for package updates to a scheduled cron job.

* Update .github/scripts/Update-NuGetPackageVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 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>

* Update .github/scripts/Update-NuGetPackageVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add pull_request_target trigger to workflow

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update package-update.yml

* Update package-update.yml

* Rename checkout step for clarity

* Remove GitHub CLI installation from package-update.yml

Removed GitHub CLI installation step from workflow.

* Update Update-NuGetPackageVersions.ps1

* Fix label assignment in package-update workflow

* Remove 'powershell' label from package update PR

Removed the 'powershell' label from the automated package update PR.

* Add label to automated package update PR

* Fix label formatting in package-update.yml

* Add token input for create pull request action

* Update GH_TOKEN to use secrets for PR creation

* Update package-update.yml

* Add script to update .NET SDK and MSBuild SDK versions

This script updates .NET SDK and MSBuild SDK versions in the global.json file by querying the latest releases and modifying the file accordingly.

* Add step to update .NET SDK versions in workflow

* Change fetch-depth from 0 to 1 in workflow

* Update package-update.yml to remove pull_request trigger

Remove pull_request trigger from package-update workflow

* Prevent branch name collisions in package-update workflow (#825)

* Initial plan

* Add run_attempt to branch name and concurrency group to prevent collisions

Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com>

* Enable cancellation of in-progress package updates

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com>

* Fix SourcesDirectory parameter fallback for GitHub Actions in Update-DotNetSdkVersions.ps1 (#826)

* Initial plan

* Add fallback logic for SourcesDirectory in Update-DotNetSdkVersions.ps1

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>

* Update .github/workflows/package-update.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/scripts/Update-DotNetSdkVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update package-update.yml

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Update-NuGetPackageVersions.ps1

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Rename workflow steps for clarity

* Update .github/scripts/Update-NuGetPackageVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix prerelease suffix ordering in Update-DotNetSdkVersions.ps1 (#831)

* Initial plan

* fix: replace simple string suffix comparison with token-by-token Compare-PreReleaseSuffix in Update-DotNetSdkVersions.ps1

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>

* Replace Azure Pipelines logging commands with GitHub Actions-native annotations in NuGet update script (#830)

* Initial plan

* Replace ##[section] Azure Pipelines logging with GitHub Actions ::notice:: annotations

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>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/scripts/Update-NuGetPackageVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/scripts/Update-DotNetSdkVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/scripts/Update-NuGetPackageVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/scripts/Update-DotNetSdkVersions.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix Get-LatestPackageVersion ignoring prerelease flag and configfile in dotnet args (#833)

* Initial plan

* Fix Get-LatestPackageVersion to correctly use prerelease and configfile args

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>

* Add NuGetConfigPath option and update workflow

Introduce an optional NugetConfigPath parameter to Update-NuGetPackageVersions.ps1 and Update-DotNetSdkVersions.ps1 so the scripts can use a configurable NuGet config file (default: NuGet.Config). Update verbose messages and warnings to reference the chosen config path and simplify config selection logic to prefer the provided config name. Update the package-update GitHub Actions workflow to pass NuGet-GitHub.Config to both scripts and switch actions/setup-dotnet to use the repository global.json (global-json-file) instead of a hardcoded dotnet-version.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Neil Richardson <neil.richardson@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants