From ab55e57c225a3b212cbd149de8eceae953ab57bf Mon Sep 17 00:00:00 2001 From: Jinzhe Pan <48981407+Eigensystem@users.noreply.github.com> Date: Mon, 30 Mar 2026 07:35:13 -0700 Subject: [PATCH] [ci] Fix Merge Queue requeue and draft PR pre-commit skip (#1197) --- .github/mergify.yml | 7 +++++++ .github/workflows/ci-precommit.yml | 4 +++- .github/workflows/ci-slash-commands.yml | 16 +++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index a58fcaac6..1590baa9e 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -305,6 +305,13 @@ pull_request_rules: queue: name: default + - name: remove ready label on dequeue + conditions: + - queue-dequeue-reason!=none + actions: + label: + remove: [ready] + - name: comment on invalid PR title format conditions: - -closed diff --git a/.github/workflows/ci-precommit.yml b/.github/workflows/ci-precommit.yml index fca4bcee0..2d9f1cc3f 100644 --- a/.github/workflows/ci-precommit.yml +++ b/.github/workflows/ci-precommit.yml @@ -14,7 +14,9 @@ permissions: jobs: pre-commit: - if: github.event.pull_request.draft != true + if: >- + github.event.pull_request.draft != true + || startsWith(github.event.pull_request.head.ref, 'mergify/merge-queue/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci-slash-commands.yml b/.github/workflows/ci-slash-commands.yml index cffc79add..de10a4989 100644 --- a/.github/workflows/ci-slash-commands.yml +++ b/.github/workflows/ci-slash-commands.yml @@ -31,20 +31,18 @@ jobs: } core.setOutput('has_write', String(hasWrite)); - - name: Add ready label and react + - name: Queue PR via Mergify and react if: steps.perm.outputs.has_write == 'true' uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.issue.number, - labels: ['ready'], - }); + const owner = context.repo.owner; + const repo = context.repo.repo; + const prNumber = context.payload.issue.number; + await github.rest.issues.addLabels({ owner, repo, issue_number: prNumber, labels: ['ready'] }); + await github.rest.issues.createComment({ owner, repo, issue_number: prNumber, body: '@mergifyio queue' }); await github.rest.reactions.createForIssueComment({ - owner: context.repo.owner, - repo: context.repo.repo, + owner, repo, comment_id: context.payload.comment.id, content: 'rocket', });