PR merging using gh cli suddenly stopped working

I’ve been using the github cli to merge PRs in one of my repositories:

 gh pr merge "$PR_URL" --admin --merge

I haven’t changed anything in a while, but now I’m getting this error when trying the same operation:

GraphQL: Field 'isInMergeQueue' doesn't exist on type 'PullRequest' (query PullRequestByNumber.repository.pullRequest.isInMergeQueue), Field 'isMergeQueueEnabled' doesn't exist on type 'PullRequest' (query PullRequestByNumber.repository.pullRequest.isMergeQueueEnabled)

Any ideas?

2 Likes

Hey folks,

Same here, our repo using merge queue (preview) won’t merge via the GH cli.

We tried:

  • gh pr merge $PR_URL
  • gh pr merge --auto $PR_URL
  • gh pr merge --squash $PR_URL

Doc is stating that we need to merge without a merge strategy, but it fails with :

  • gh pr merge --auto $PR_URL

Run gh pr merge --auto "https://github.com/doctolib/dev-cockpit/pull/38"
--merge, --rebase, or --squash required when not running interactively
Usage:  gh pr merge [<number> | <url> | <branch>] [flags]
Flags:
      --admin            Use administrator privileges to merge a pull request that does not meet requirements
      --auto             Automatically merge only after necessary requirements are met
  -b, --body text        Body text for the merge commit
  -F, --body-file file   Read body text from file (use "-" to read from standard input)
  -d, --delete-branch    Delete the local and remote branch after merge
      --disable-auto     Disable auto-merge for this pull request
  -m, --merge            Merge the commits with the base branch
  -r, --rebase           Rebase the commits onto the base branch
  -s, --squash           Squash the commits into one commit and merge it into the base branch
  -t, --subject text     Subject text for the merge commit
  • gh pr merge $PR_URL
Run gh pr merge "https://github.com/doctolib/dev-cockpit/pull/38"
--merge, --rebase, or --squash required when not running interactively
Usage:  gh pr merge [<number> | <url> | <branch>] [flags]
Flags:
      --admin            Use administrator privileges to merge a pull request that does not meet requirements
      --auto             Automatically merge only after necessary requirements are met
  -b, --body text        Body text for the merge commit
  -F, --body-file file   Read body text from file (use "-" to read from standard input)
  -d, --delete-branch    Delete the local and remote branch after merge
      --disable-auto     Disable auto-merge for this pull request
  -m, --merge            Merge the commits with the base branch
  -r, --rebase           Rebase the commits onto the base branch
  -s, --squash           Squash the commits into one commit and merge it into the base branch
  -t, --subject text     Subject text for the merge commit
  • gh pr merge --squash $PR_URL
Run gh pr merge --squash "https://github.com/doctolib/dev-cockpit/pull/38"
Message: Commits to this branch must be added using the merge queue., Locations: [{Line:1 Column:58}]
Error: Process completed with exit code 1.
2 Likes