Skip to content

ci: re-anchor next-release PR after the release is published#9

Open
androosio wants to merge 1 commit into
mainfrom
ci/reconcile-release-pr
Open

ci: re-anchor next-release PR after the release is published#9
androosio wants to merge 1 commit into
mainfrom
ci/reconcile-release-pr

Conversation

@androosio

Copy link
Copy Markdown
Owner

Problem

Every time a release PR is merged, Release Please opens a spurious next-release PR that re-lists already-released commits (e.g. the bogus chore(main): release 1.2.0 seen after v1.1.2 shipped).

Root cause, confirmed from the run log (⚠ Expected 1 releases, only found 0 / looking for tagName: v1.1.2): the release-please job computes the next release PR in the same pass that creates the release for the just-merged release PR. At that moment the new release is still a draft (the publish job only flips it to published afterwards, once the signed APK is attached). A draft GitHub release has no git tag and isn't recognised as "the latest release", so Release Please falls back to an older release and re-collects already-released commits.

A corrected pass alone won't retract the stale PR (verified: re-running Release Please after publish left the bad PR open).

Fix

New reconcile job, gated on release_created, running after publish:

  1. Close any release-please--branches--main PR left open from the draft-window pass (delete its branch).
  2. Re-run release-please-action against the now-published release, so it reopens a correctly-anchored PR only if something genuinely landed during the release run.

Keeps draft: true (release stays private until the APK is attached) while removing the race.

Notes

  • Won't visibly take effect until the next release run; low blast radius (only runs when release_created == true).
  • YAML validated locally.

🤖 Generated with Claude Code

release-please computes the next-release PR in the same pass that creates
the release for a just-merged release PR. On that pass the new release is
still a draft (the publish job only flips it afterwards), and a draft
GitHub release has no tag and isn't recognised as the latest release -- so
release-please mis-anchors on an older release and opens a bogus PR that
re-lists already-released commits (observed as the spurious "release
1.2.0" PR after v1.1.2).

Add a reconcile job that runs after publish: close any release PR left
open from the draft-window pass, then re-run release-please against the
now-published release so it reopens a correctly-anchored PR only if
something genuinely remains unreleased.

Keeps draft:true (the release stays private until the signed APK is
attached) while removing the race.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant