Skip to content

fix: create_pr_if_not_exists check for closed/merged branches too#208

Merged
HowardBraham merged 2 commits intomainfrom
fix/INFRA-3257-additional-changelog-pr
Jan 29, 2026
Merged

fix: create_pr_if_not_exists check for closed/merged branches too#208
HowardBraham merged 2 commits intomainfrom
fix/INFRA-3257-additional-changelog-pr

Conversation

@jluque0101
Copy link
Contributor

@jluque0101 jluque0101 commented Jan 27, 2026

Description

Fixes an issue where a duplicate changelog PR is created immediately after merging an existing changelog PR into a release branch.

Problem

When a changelog PR (e.g., release/13.14.1-Changelog) is merged:

  1. A push event fires to the release branch
  2. The update-release-changelog workflow triggers
  3. create_pr_if_not_exists() checks for existing PRs using gh pr list
  4. Bug: gh pr list only returns open PRs by default — the merged PR is not found
  5. A duplicate changelog PR is created

Solution

Added --state all flag to gh pr list commands in create_pr_if_not_exists() to include merged/closed PRs in the search.

Tested here: https://github.com/consensys-test/metamask-extension-infra-3257/actions/runs/21397035008/job/61709774559


Note

Low Risk
Low risk shell script change that only broadens PR existence checks in GitHub CLI calls; main risk is unexpected behavior if multiple historical PRs match the same head name.

Overview
Prevents release automation from creating duplicate PRs by updating create_pr_if_not_exists() in .github/scripts/utils.sh to have gh pr list include closed and merged PRs via --state all when checking for an existing PR.

Written by Cursor Bugbot for commit 3460650. This will update automatically on new commits. Configure here.

@jluque0101 jluque0101 marked this pull request as ready for review January 28, 2026 09:46
@HowardBraham
Copy link
Contributor

The linked test somehow took 54 minutes to run https://github.com/consensys-test/metamask-extension-infra-3257/actions/runs/21397035008/job/61709774559

Is that because it's trying to construct a CHANGELOG from the beginning of time?

@jluque0101
Copy link
Contributor Author

The linked test somehow took 54 minutes to run https://github.com/consensys-test/metamask-extension-infra-3257/actions/runs/21397035008/job/61709774559

Is that because it's trying to construct a CHANGELOG from the beginning of time?

hey @HowardBraham , yes that's a side effect of testing in a fork and not related to the change itself.
We would get the same behavior even with the current version of the github-tools.

@HowardBraham HowardBraham merged commit 3b38631 into main Jan 29, 2026
21 checks passed
@HowardBraham HowardBraham deleted the fix/INFRA-3257-additional-changelog-pr branch January 29, 2026 17:25
@christopherferreira9 christopherferreira9 mentioned this pull request Feb 4, 2026
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