Skip to content

feat(core,node-gha): resolve last release tag through project to support bundled release commits#165

Merged
dangreen merged 1 commit into
mainfrom
feat/project-last-release-tag
Jul 6, 2026
Merged

feat(core,node-gha): resolve last release tag through project to support bundled release commits#165
dangreen merged 1 commit into
mainfrom
feat/project-last-release-tag

Conversation

@dangreen

@dangreen dangreen commented Jul 6, 2026

Copy link
Copy Markdown
Member

The problem

node-gha release tags point to bundled commits on the release branches (latest, vN) which are never merged back to the source branch. Tag discovery in bump, changelog generation, and maintenance branch detection walks the current branch history (git log --decorate), so those tags are invisible:

  • the bump type is computed from commits since an older reachable tag, re-counting already released commits (a feat! released in 2.0.0 turns the next patch into a false 3.0.0);
  • the changelog duplicates already released entries and points the compare link at the wrong previous tag.

Real-world example: TrigenSoftware/simple-release-action#25 proposed 3.0.0 with a duplicated breaking change instead of 2.0.1.

The fix

  • core: new Project#getLastReleaseTag(options) method — the single point of last release tag resolution. Default implementation keeps the current behavior (getLastSemverTag over branch history). It is now used by getNextVersion (first release detection + explicit tag for Bumper), changelog generation in bump (commits.from + context.previousTag), getMaintenanceBranches, and fixed monorepo first release detection.
  • node-gha: overrides getLastReleaseTag — walks all refs via getSemverTags({ all: true }) (new option in @conventional-changelog/git-client 3.1.0, feat(git-client): add all option to getTags to walk all refs conventional-changelog/conventional-changelog#1501) in commit date order and returns the first tag whose commit or parent is reachable from HEAD. A bundled release commit is amended from the release commit, so its parent lands in the source branch; the reachability check also keeps maintenance branches isolated from other branches' tags.

Covered by node-gha specs with a real bundled release (publish() into a bare remote): last tag resolution on the source branch, patch bump + changelog content after an action release, and per-branch resolution on a maintenance branch.

Note

Release tags published by node-gha before 3.0.3 (#157) are parentless root commits — they share no history with the source branch and cannot be matched by reachability. Such tags are skipped; e.g. simple-release-action's v2.0.0 needs a one-time re-tag with a proper parent.

🤖 Generated with Claude Code

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 28791044610

Coverage increased (+0.6%) to 60.49%

Details

  • Coverage increased (+0.6%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (17 of 18 lines covered, 94.44%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
packages/node-gha/src/project.ts 10 9 90.0%
Total (3 files) 18 17 94.44%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 952
Covered Lines: 635
Line Coverage: 66.7%
Relevant Branches: 516
Covered Branches: 253
Branch Coverage: 49.03%
Branches in Coverage %: Yes
Coverage Strength: 9.25 hits per line

💛 - Coveralls

@dangreen dangreen merged commit 5e65aa7 into main Jul 6, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 6, 2026
@dangreen dangreen deleted the feat/project-last-release-tag branch July 6, 2026 12:39
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