From b44b84f0a34fa6ed62de300237cbd592c3260edb Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Mon, 12 Oct 2026 11:40:45 +0400 Subject: [PATCH] ci: let the master-to-main merge wait for every required check The auto-merge job fires when CI finishes, but Code Quality, Security and CodeQL can still be running then. Once main requires those checks, a direct merge at that moment is refused and nothing would retry it. Try the merge, and if the branch rules do not allow it yet, hand it to GitHub auto-merge. --- .github/workflows/auto-merge.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 37fa5f9..7bf56bb 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -40,8 +40,15 @@ jobs: exit 0 fi + # CI finishing does not mean every required check has: Code Quality, + # Security and CodeQL may still be running. Merge now if the branch + # rules allow it, otherwise let GitHub merge once they pass. echo "Merging PR #$PR_NUMBER" gh pr merge "$PR_NUMBER" \ --repo "$GITHUB_REPOSITORY" \ --merge \ - --delete-branch=false + --delete-branch=false \ + || gh pr merge "$PR_NUMBER" \ + --repo "$GITHUB_REPOSITORY" \ + --merge \ + --auto