Use NBGV IGNORE_GITHUB_REF instead of the ineffective GITHUB_REF override - #222
Merged
Conversation
…ride Fixes #221, supersedes the #215 mechanism. #215 tried to restore the develop leg's prerelease tag by overriding GITHUB_REF in the nbgv step env. That does not work: GITHUB_REF is a GitHub-reserved variable a step env cannot reliably override (the runner re-injects the dispatch ref), so NBGV's GitHub Actions provider still read refs/heads/main for every leg on a main-dispatched publish and classified the develop leg as a public release (clean, stable version). NBGV versions from the checked-out branch unless its cloud provider overrides with GITHUB_REF. Set IGNORE_GITHUB_REF=true so NBGV ignores the CI ref and uses the checked-out branch, which each matrix leg already is. Drop the now-useless `branch` input from get-version-task.yml and its threading from all five callers. The validate-release entry gate stays as the backstop. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes NBGV branch classification in the publish matrix by using NBGV's supported IGNORE_GITHUB_REF switch (so versioning follows the checked-out ref per leg) and removes the prior, ineffective GITHUB_REF override mechanism.
Changes:
- Set
IGNORE_GITHUB_REF=truefor thedotnet/nbgv@masterstep so NBGV ignores the workflow dispatch ref. - Remove the now-unused
branchinput fromget-version-task.yml. - Remove
branch:threading intoget-version-task.ymlfrom all reusable workflow callers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/get-version-task.yml | Drop branch input and switch NBGV to IGNORE_GITHUB_REF for correct per-checkout versioning. |
| .github/workflows/build-release-task.yml | Stop passing branch into get-version-task.yml (versioning no longer relies on env overrides). |
| .github/workflows/build-pypilibrary-task.yml | Remove branch passthrough to get-version-task.yml. |
| .github/workflows/build-nugetlibrary-task.yml | Remove branch passthrough to get-version-task.yml. |
| .github/workflows/build-executable-task.yml | Remove branch passthrough to get-version-task.yml. |
| .github/workflows/build-docker-task.yml | Remove branch passthrough to get-version-task.yml. |
NBGV string-compares the value to "true"; env values are strings, so quoting makes the intent explicit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ptr727
added a commit
that referenced
this pull request
Jul 4, 2026
Promote the accumulated `develop` work to `main`. Twelve changes since the last promotion: - Add `WORKFLOW.md`: workflow style, architecture, behavioral contract, test methodology (#223) - Use NBGV `IGNORE_GITHUB_REF` instead of the ineffective `GITHUB_REF` override (#222) - Skip validate-release on smoke builds (#220) - Gate asset delete on the release create/refresh condition (#218) - Ship branch rulesets as versioned JSON in the re-sync / drift loop (#212) - Clean up transfer artifacts surgically at consumption, not blanket-delete (#216) - Version each publish leg against its own branch; validate at entry (#215) - Consolidate workspace configurations into a unified ProjectTemplate workspace (#210) - Template convergence barrier: absorb pins, generic release + docker-readme, carry-whole-file (#207) - Key merge-bot concurrency on PR number, not `github.ref` (#206) - Codify orchestrated re-sync personas and full-replacement rule (#205) - Lead action pins; affirm pattern-based artifact handoff (#204) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #221; supersedes the mechanism from #215. The #213 fix (PR #215) restored the develop leg's prerelease tag by overriding
GITHUB_REFin the nbgv stepenv:. It doesn't work.GITHUB_REFis GitHub-reserved — a step-levelenv:can't reliably override it (the runner re-injects the dispatch ref). NBGV's GitHub Actions cloud-build provider readsGITHUB_REFforBuildingRef, so on a publish dispatched frommainthe develop leg was still classified public and would publish a clean (stable) version.CI evidence from the first real publish after #215:
(The
validate-releasegate correctly blocked the bad publish, so nothing shipped — but the develop prerelease leg never publishes.)Fix
NBGV versions from the checked-out branch unless its cloud provider overrides with
GITHUB_REF. Each matrix leg already checks out its own branch, so set NBGV's ownIGNORE_GITHUB_REF=trueto make it ignore the CI ref:GITHUB_REF/GITHUB_REF_NAMEoverride.branchinput fromget-version-task.ymland its threading from all five callers (build-release-task+ the fourbuild-*-task).validate-releaseentry gate (from Publish matrix mislabels the develop leg as a public release: NBGV drops the prerelease tag, NuGet package published as stable #213/Version each publish leg against its own branch; validate at entry #215, smoke-skip from validate-release gate fails main-base PR smoke builds, blocking develop->main promotions #219) stays as the backstop.NBGV source confirms the knob:
BuildingRef => IgnoreGitHubRef ? null : env GITHUB_REF.Verification
actionlint(Docker) clean on all six changed workflows; CRLF preserved.dotnet/nbgv):developcheckout +IGNORE_GITHUB_REF=true→PublicRelease=False,1.4.2-g…;main→True,1.4.3;mainwithout the flag reproduces the bug.🤖 Generated with Claude Code