Skip to content

ci: defer release-please PR creation while a draft release is pending - #3108

Merged
afonsojramos merged 2 commits into
mainfrom
ci/defer-release-pr-during-draft
Jul 29, 2026
Merged

ci: defer release-please PR creation while a draft release is pending#3108
afonsojramos merged 2 commits into
mainfrom
ci/defer-release-pr-during-draft

Conversation

@afonsojramos

Copy link
Copy Markdown
Member

Problem

After every release-PR merge, release-please opens a bogus next-version PR whose changelog regenerates from a months-old base (#3096 after 7.1.0, #3107 after 7.1.1).

Root cause

Our releases start as drafts (electron-builder can only upload signed artifacts to a draft), and a draft release has no git tag until the publish pipeline flips it ~15 minutes later. release-please's single invocation creates the draft and then immediately runs its release-PR phase: with the manifest already at the new version but no matching tag (googleapis/release-please#1650), it finds no anchor and regenerates a "next release" from its full search window - hence a 7.2.0 PR re-listing features from May. Any push to main during the draft window does the same. Once the tag exists, later runs report "no user facing commits - skipping" and never clean the stale PR up.

Fix

Split release-please into two phased steps inside the existing job:

  1. Releases only (skip-github-pull-request: true) - unchanged behavior for release creation; keeps the release_created / tag_name outputs the downstream jobs consume.
  2. Draft gate: count unpublished draft releases (including the one step 1 may have just created).
  3. Release PR only (skip-github-release: true), run only when there are no pending drafts - i.e. the previous release's tag exists and a correct anchor is available.

The next release PR is then created on the first push to main after the draft publishes, which is the earliest moment it can be generated correctly anyway. A permanently stuck draft intentionally pauses release-PR creation until it is resolved, which is the safe behavior (see 7.1.0's stuck draft).

Validated with actionlint and zizmor (both clean).

Note: #3107 still needs to be closed manually once v7.1.1 publishes; this change prevents recurrence, it does not clean up existing stale PRs.

@afonsojramos
afonsojramos requested a review from setchy as a code owner July 29, 2026 11:26
@github-actions github-actions Bot added the build Build, action or package manager changes label Jul 29, 2026
@afonsojramos
afonsojramos merged commit 25d7f9b into main Jul 29, 2026
11 checks passed
@afonsojramos
afonsojramos deleted the ci/defer-release-pr-during-draft branch July 29, 2026 11:31
@github-actions github-actions Bot added this to the Release 7.x.x milestone Jul 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, action or package manager changes

Development

Successfully merging this pull request may close these issues.

2 participants