core icon indicating copy to clipboard operation
core copied to clipboard

ci: Skip merge queue if pull request is up-to-date

Open Mrtenz opened this issue 2 months ago • 0 comments

Explanation

This adds a new action which determines whether a pull request in the merge queue is up-to-date, meaning:

  • The pull request is based on the latest commit on main.
  • The pull request is the first in the merge queue.

In this case, all status checks have already passed on the branch, and running in the merge queue would be redundant, meaning we can skip the merge queue checks.

To accomplish this, I've added an output to the action (up-to-date) which we can use in all steps in the main workflow to determine if they should run. If up-to-date is true, all jobs except all-jobs-pass will be skipped, and the pull request will be merged much quicker.

References

WPC-184

Checklist

  • [ ] I've updated the test suite for new or updated code as appropriate
  • [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • [ ] I've communicated my changes to consumers by updating changelogs for packages I've changed
  • [ ] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

[!NOTE] Adds a composite action and workflow gating to skip merge-queue jobs when the PR is up-to-date and first in queue.

  • CI
    • New composite action ./.github/actions/check-merge-queue/action.yml:
      • Parses PR number from head-ref, queries GraphQL for headRefName and mergeQueueEntry.position, and outputs up-to-date=true when base is ancestor and position is 1.
    • Main workflow updates ./.github/workflows/main.yml:
      • Adds check-skip-merge-queue job (on merge_group) to set skip-merge-queue output.
      • Gates check-workflows, analyse-code, lint-build-test, and check-release to run only when not skipping.
      • Updates needs across jobs to include check-skip-merge-queue and adjusts all-jobs-pass to pass when either all jobs succeed or skip is enabled.

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

Mrtenz avatar Dec 16 '25 12:12 Mrtenz