From f45b70d8118824b6385f9dd56fecd84782c6fb9a Mon Sep 17 00:00:00 2001 From: prrao87 <35005448+prrao87@users.noreply.github.com> Date: Mon, 22 Jun 2026 10:15:25 -0400 Subject: [PATCH] chore(ci): merge OpenAPI sync PR via direct merge instead of auto-merge The sync workflow used peter-evans/enable-pull-request-automerge, which requires the repo-level "Allow auto-merge" setting. That setting is now disabled (to stop an external agent from queueing auto-merges without review), so the auto-merge step fails with "Auto merge is not allowed for this repository". Replace it with a direct merge: wait for the required check to pass, then squash-merge immediately. A direct merge does not depend on the auto-merge toggle, so it can stay off permanently. The trusted sync identity has the Repository-admin ruleset bypass, so it merges through the required-review gate while untrusted actors remain blocked. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/sync-openapi.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-openapi.yml b/.github/workflows/sync-openapi.yml index 3f61207c..c54d6ee4 100644 --- a/.github/workflows/sync-openapi.yml +++ b/.github/workflows/sync-openapi.yml @@ -44,10 +44,17 @@ jobs: branch: "chore/sync-openapi" delete-branch: true - - name: Enable auto-merge (when checks pass) + - name: Wait for checks and merge if: steps.cpr.outputs.pull-request-number != '' - uses: peter-evans/enable-pull-request-automerge@v3 - with: - token: ${{ secrets.DOCS_BOT_TOKEN }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash + env: + GH_TOKEN: ${{ secrets.DOCS_BOT_TOKEN }} + run: | + set -euo pipefail + pr="${{ steps.cpr.outputs.pull-request-number }}" + # Give the pull_request workflow a moment to register checks before watching. + for i in $(seq 1 10); do + if gh pr checks "$pr" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1; then break; fi + sleep 15 + done + gh pr checks "$pr" -R "$GITHUB_REPOSITORY" --watch --fail-fast --interval 30 + gh pr merge "$pr" -R "$GITHUB_REPOSITORY" --squash --delete-branch