Skip to content

ci: publish to NuGet only for release PR merges to main - #551

Open
TimPurdum wants to merge 2 commits into
developfrom
feature/release-gate
Open

TimPurdum wants to merge 2 commits into
developfrom
feature/release-gate

Conversation

@TimPurdum

Copy link
Copy Markdown
Collaborator

Every push to main ran main-release-build.yml, which builds and pushes Core and Pro to NuGet. Dependabot security updates always target the default branch, so merging a batch of them today published an unplanned 4.7.1. That version has the same library code as 4.7.0, plus a bump to the Core test app.

Changes

  • New release-gate job looks up the PR merged by the pushed commit. build and nuget-push run only when that PR's head branch is develop or release/*, or when the workflow is started manually.
  • The release notes step reads the body of that PR. It used to take the most recently closed PR, which is why the 4.7.1 release showed the picomatch bump as its notes.

Testing

This lands on main with the next release. Until then, merging a Dependabot PR on main still publishes.

🤖 Generated with Claude Code

TimPurdum and others added 2 commits October 20, 2026 18:45
Every push to main ran the release build and pushed Core and Pro to
NuGet. Dependabot security updates always target the default branch,
so merging them on 2026-10-20 published an unplanned 4.7.1.

A release-gate job now looks up the PR behind the pushed commit and
allows the build only when its head branch is develop or release/*,
or when the workflow is run manually. The release notes step reads
that PR instead of the most recently closed one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release gate validates github.sha, but checkout uses the moving github.ref, allowing an unvalidated commit to be packaged and published with mismatched PR notes.

1 open issue
What changed in this PR

Restricts GeoBlazor Core and Pro releases to prevent routine merges into main, such as Dependabot updates, from triggering unintended NuGet publications.

Changes:

  • Gates publishing on merged PRs from develop or release/*, while allowing manual runs.
  • Uses the matched PR’s body for release notes instead of the most recently closed PR.
  • Bumps Core and Pro build versions from 4.7.0.5 to 4.7.0.6.
File Description
pro/​Directory.Build.props Bumps the Pro build version to 4.7.0.6.
Directory.Build.props Bumps the Core build version to 4.7.0.6.
.github/​workflows/​main-release-build.yml Adds the release gate and ties release notes to the matched PR.

Review effort: Balanced


build:
needs: release-gate
if: needs.release-gate.outputs.should-release == 'true'

This branch has not been deployed

No deployments
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