Skip to content

fix: correct release workflow sequencing to merge changelog PR before tagging#40

Open
ricogu wants to merge 2 commits intomainfrom
fix/release-workflow-sequencing
Open

fix: correct release workflow sequencing to merge changelog PR before tagging#40
ricogu wants to merge 2 commits intomainfrom
fix/release-workflow-sequencing

Conversation

@ricogu
Copy link
Copy Markdown
Member

@ricogu ricogu commented Feb 6, 2026

Summary

This PR fixes the release workflow which had a critical sequencing issue where the changelog PR was created but never merged before the release was tagged.

Changes

  • Added fromTag detection: New step to get the previous release tag for proper changelog delta generation
  • Added auto-merge for changelog PR: Enables auto-merge on the changelog PR using gh pr merge --auto --squash
  • Added wait for merge: Polls PR state for up to 5 minutes to ensure changelog is merged before proceeding
  • Added fresh checkout after merge: Re-checks out main after the changelog PR is merged to include the updated CHANGELOG.md
  • Fixed cleanup step: Now correctly cleans up the changelog branch instead of the release branch

New Workflow Flow

  1. Validate version
  2. Get previous tag (for changelog delta)
  3. Generate changelog (from last tag to HEAD)
  4. Create changelog PR and enable auto-merge
  5. Wait for PR to merge (polls up to 5 min)
  6. Checkout updated main (now includes changelog)
  7. Update @main references to @v{major}
  8. Create tags (v1.2.3 and v1)
  9. Create GitHub release with changelog as notes
  10. Cleanup changelog branch

Requirements

  • Auto-merge must be enabled in repository settings for this workflow to function correctly

Copy link
Copy Markdown
Collaborator

@ricogu-claw ricogu-claw left a comment

Choose a reason for hiding this comment

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

This is a solid fix for the core sequencing issue: the workflow now waits for the changelog PR to merge before proceeding to tagging, which addresses the main failure mode we saw.

A couple of points I’d still want called out before merge:

  1. This fixes sequencing, but not full changelog/release-note consistency
    The workflow still creates the GitHub release body from steps.changelog.outputs.changelog instead of the final merged CHANGELOG.md content:

    body: ${{ steps.changelog.outputs.changelog }}

    So the changelog in the repo and the GitHub release notes can still drift if the generated content is modified before merge. I opened #50 to track that follow-up explicitly.

  2. Please keep this PR scoped to the workflow fix only
    If there are any unrelated changes on the branch (for example changelog/package/dist files picked up during development), I’d drop them before merge so this stays focused on the release sequencing change.

  3. Auto-merge is now a workflow dependency
    The new flow depends on repo settings / branch protection allowing gh pr merge --auto --squash to complete successfully. That is fine if intentional, but worth being explicit about.

Overall: I think this is moving in the right direction and is mergeable once the scope is clean and the above limitation is understood.

@ricogu-claw
Copy link
Copy Markdown
Collaborator

Follow-up for the remaining gap after this sequencing fix: #50

I updated the issue description to make the context concrete and to reference the right PRs:

The remaining tracking item is that the GitHub release body is still derived from the pre-merge generated changelog output rather than the final merged CHANGELOG.md entry.

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