-
Notifications
You must be signed in to change notification settings - Fork 7.6k
gh pr merge --delete-branch exits with error when merge requested via merge queue
#10074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
BagToad
merged 2 commits into
trunk
from
kw/cli-7011-fix-delete-branch-with-merge-queue-v2
Dec 12, 2024
Merged
gh pr merge --delete-branch exits with error when merge requested via merge queue
#10074
BagToad
merged 2 commits into
trunk
from
kw/cli-7011-fix-delete-branch-with-merge-queue-v2
Dec 12, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When running `gh pr merge -d` on a repo with a merge queue policy, exit before attempting to merge.
gh pr merge --delete-branch exits with error when PR merged via merge queuegh pr merge --delete-branch exits with error when merge requested via merge queue
jtmcg
approved these changes
Dec 12, 2024
Contributor
jtmcg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Dec 21, 2024
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [cli/cli](https://github.com/cli/cli) | minor | `v2.63.2` -> `v2.64.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>cli/cli (cli/cli)</summary> ### [`v2.64.0`](https://github.com/cli/cli/releases/tag/v2.64.0): GitHub CLI 2.64.0 [Compare Source](cli/cli@v2.63.2...v2.64.0) #### What's Changed - docs: improve docs for browse command as of [#​5352](cli/cli#5352) by [@​ankddev](https://github.com/ankddev) in cli/cli#10025 - Open MR against gh-merge-base by [@​heaths](https://github.com/heaths) in cli/cli#9712 - Add integration tests for `gh attestation verify` when the `bundle-from-oci` flag is specified by [@​malancas](https://github.com/malancas) in cli/cli#10020 - `gh repo rename` help text clarifies new repo name should not include owner by [@​BagToad](https://github.com/BagToad) in cli/cli#10044 - fix: list branches in square brackets in `gh run` and `gh codespace` by [@​uday-rana](https://github.com/uday-rana) in cli/cli#10043 - Bump actions/attest-build-provenance from 1.4.4 to 2.1.0 by [@​dependabot](https://github.com/dependabot) in cli/cli#10056 - Bump golang.org/x/crypto from 0.29.0 to 0.31.0 by [@​dependabot](https://github.com/dependabot) in cli/cli#10070 - Improve documentation and error messaging for local extension installations without executables by [@​BagToad](https://github.com/BagToad) in cli/cli#9933 - docs: better document auth scopes by [@​ankddev](https://github.com/ankddev) in cli/cli#10026 - Sigstore verifier logic updates by [@​malancas](https://github.com/malancas) in cli/cli#9999 - `gh pr merge --delete-branch` exits with error when merge requested via merge queue by [@​BagToad](https://github.com/BagToad) in cli/cli#10074 - sundry `gh at inspect` improvements by [@​phillmv](https://github.com/phillmv) in cli/cli#9954 - Support `pr view` for intra-org forks by [@​williammartin](https://github.com/williammartin) in cli/cli#10078 - Print policy information before verifying attestations by [@​malancas](https://github.com/malancas) in cli/cli#9891 - Improve error handling in apt setup script by [@​jobegrabber](https://github.com/jobegrabber) in cli/cli#10055 - Use Windows compatible file name for downloaded attestations when running `gh attestation download` by [@​malancas](https://github.com/malancas) in cli/cli#10051 - Bump github.com/cpuguy83/go-md2man/v2 from 2.0.5 to 2.0.6 by [@​dependabot](https://github.com/dependabot) in cli/cli#10094 - Perform all `gh attestation verify` policy options configuration in the `newEnforcementCriteria()` function by [@​malancas](https://github.com/malancas) in cli/cli#10012 #### New Contributors - [@​ankddev](https://github.com/ankddev) made their first contribution in cli/cli#10025 - [@​uday-rana](https://github.com/uday-rana) made their first contribution in cli/cli#10043 - [@​jobegrabber](https://github.com/jobegrabber) made their first contribution in cli/cli#10055 **Full Changelog**: cli/cli@v2.63.2...v2.64.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS43Ny4wIiwidXBkYXRlZEluVmVyIjoiMzkuNzcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
ferrarimarco
added a commit
to super-linter/super-linter
that referenced
this pull request
Jan 20, 2025
Remove the --delete-branch option in the dependency automation workflow. Ref: cli/cli#10074
10 tasks
ferrarimarco
added a commit
to super-linter/super-linter
that referenced
this pull request
Jan 20, 2025
Remove the --delete-branch option in the dependency automation workflow. Ref: cli/cli#10074
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When running
gh pr merge -don a repo with a merge queue policy, exit before attempting to merge.Attempting to delete the remote branch with a PR that will be merged with a merge queue can cause the PR to be unexpectedly closed and the remote branch deleted before a successful merge.
Alternative fix #7011.
Demo
Current Behavior...
Proposed...
Notes
To reproduce this, you have to configure a repository with a ruleset that requires a merge queue. The merge queue must be configured in some way that allows a PR to wait in the merge queue for some amount of time.
The following settings will work to accomplish that when one PR is in the merge queue:
merge queue settings image