Skip to content

Fix develop prerelease tagging: IGNORE_GITHUB_REF (supersedes the GITHUB_REF override)#198

Merged
ptr727 merged 3 commits into
developfrom
fix/nbgv-ignore-github-ref
Jun 26, 2026
Merged

Fix develop prerelease tagging: IGNORE_GITHUB_REF (supersedes the GITHUB_REF override)#198
ptr727 merged 3 commits into
developfrom
fix/nbgv-ignore-github-ref

Conversation

@ptr727

@ptr727 ptr727 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Problem

The release-workflow re-sync (#196, template ProjectTemplate#215) tried to restore the develop leg's dropped prerelease tag by overriding GITHUB_REF in the nbgv step env. The first real publish after it landed proved that's ineffective: the develop leg still published a clean version (validate-release correctly blocked it).

Root cause (from NBGV source + CI logs): NBGV's GitHub Actions cloud-build provider reads GITHUB_REF, but GITHUB_REF is a reserved GitHub variable a step-level env: cannot reliably override — the runner re-injects the dispatch ref. CI evidence: the step env showed GITHUB_REF=refs/heads/develop, yet NBGV reported "BuildingRef": "refs/heads/main"PublicRelease=true → clean 1.4.2.

Fix

NBGV versions from the checked-out branch history; its cloud-build provider only overrides that with GITHUB_REF. Set NBGV's own IGNORE_GITHUB_REF=true so it ignores the CI ref and uses the actually-checked-out branch — each matrix leg already checks out its own branch (Switched to a new branch 'develop').

Also removes the now-unused branch input/threading that existed only for the GITHUB_REF override. The validate-release entry gate stays as the backstop.

Verified in CI (probe with the real dotnet/nbgv action)

checkout IGNORE_GITHUB_REF PublicRelease SemVer2
develop true False 1.4.2-g14f645dfd9 (prerelease ✅)
main true True 1.4.3 (stable ✅)
main false False 1.4.3-g… (bug reproduced)

🤖 Generated with Claude Code

ptr727 and others added 3 commits June 26, 2026 14:08
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…verride

The #196 re-sync (template #215) tried to restore the develop leg's prerelease
tag by overriding GITHUB_REF in the nbgv step env. That is ineffective:
GITHUB_REF is a reserved GitHub variable a step-level env cannot reliably
override, so NBGV's GitHub Actions cloud-build provider still read the dispatch
ref (main) as BuildingRef and classified every matrix leg as the public ref.

NBGV computes the version from the checked-out branch history; its cloud-build
provider only overrides that with GITHUB_REF. Set IGNORE_GITHUB_REF=true so NBGV
ignores the CI ref and versions from the actually-checked-out branch (each leg
already checks out its own branch).

Verified in CI (dotnet/nbgv action):
- checkout develop, IGNORE_GITHUB_REF=true  -> PublicRelease=False, 1.4.2-g14f645dfd9
- checkout main,    IGNORE_GITHUB_REF=true  -> PublicRelease=True,  1.4.3
- checkout main,    IGNORE_GITHUB_REF=false -> suffix (reproduces the bug)

Removes the now-unused branch input/threading added for the GITHUB_REF override;
the validate-release entry gate stays as the backstop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 21:12

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.

Pull request overview

Fixes incorrect version classification in the release workflows by switching the NBGV GitHub Actions integration from an ineffective GITHUB_REF override approach to using NBGV’s dedicated “ignore GitHub ref” mechanism, and removes now-unneeded branch threading into the version task.

Changes:

  • Update the versioning task to ignore GITHUB_REF and derive versioning from the checked-out ref instead.
  • Remove the branch input pass-through from workflows that call the version task.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/get-version-task.yml Switch NBGV behavior to ignore the runner ref and version from the checked-out ref (and remove the now-unused branch input).
.github/workflows/build-release-task.yml Stop passing branch into the version task since the version task no longer accepts/needs it.
.github/workflows/build-nugetlibrary-task.yml Stop passing branch into the version task since the version task no longer accepts/needs it.

Comment thread .github/workflows/get-version-task.yml
@ptr727 ptr727 merged commit 64e3b62 into develop Jun 26, 2026
8 checks passed
@ptr727 ptr727 deleted the fix/nbgv-ignore-github-ref branch June 26, 2026 23:44
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