Allow Bugbot to pass GitHub merge queue

Feature request for product/service

BugBot

Describe the request

We have recently enabled Bugbot in our GitHub repository and are very pleased with the quality of its reviews. So pleased, that we would like to make Bugbot review a required step before merging a pull request! This is indeed possible by making a branch protection rule with Require status checks to pass before merging and adding Cursor Bugbot as a required check. This makes it so that merging is not possible if Bugbot has not run on the latest push to the PR.

But alas! This does not work together with GitHub merge queue that we also use. What we observe is that all merge queue runs get stuck waiting for required steps. So the required check for Bugbot applies to merge queue branches as well, but Bugbot does not (as expected, and correctly) run on merge queue branches.

It would be great if Bugbot detected a merge queue run as set itself as success there without actually doing anything.

In the meantime we are left considering if we can write a GitHub Actions job that checks for bug OR merge queue and marks itself as successful based on either. As we have not done that yet, we are not even sure it it is possible.

Operating System (if it applies)

Linux

This is what I landed with for self-written GitHub Actions jobs to achieve this. In the end team did not want to enforce Bugbot on the very last commit in this way, because Bugbot needs some minutes to run, thus perhaps interrupting otherwise complete PR flow, and this approach also needs manual action to trigger Bugbot when it is missing. So, while I did test this one a lot, it is not proved itself in real use.

check-bugbot:
  runs-on: ubuntu-24.04
  permissions:
    checks: read
  timeout-minutes: 1
  steps:
    - name: Check if Bugbot has run for the PR
      uses: actions/[email protected]
      with:
        script: |
          if (context.eventName !== "pull_request") {
            return
          }
          const checks = await github.rest.checks.listForRef({
            owner: context.repo.owner,
            repo: context.repo.repo,
            ref: context.payload.pull_request.head.sha,
            // If more than 100 checks appear, need to start paginating
            per_page: 100
          })

          const bugbotRun = checks.data.check_runs.find(r => r.name === "Cursor Bugbot")
          if (!bugbotRun) {
            core.setFailed("Bugbot not run")
            return
          }
          if (bugbotRun.conclusion !== "neutral") {
            core.setFailed("Bugbot review required")
            return
          }