From 0ac29784ee49d4000fd6e71457803a9d42924879 Mon Sep 17 00:00:00 2001 From: "privilegedescalation-engineer[bot]" <269729446+privilegedescalation-engineer[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:59:27 +0000 Subject: [PATCH] fix(release): fall back to direct merge when auto-merge is rejected (#71) On repos without required status checks in branch protection, GitHub rejects enablePullRequestAutoMerge with 'clean status' error. Add a fallback to direct squash merge so releases complete without manual intervention. Fixes: https://github.com/privilegedescalation/.github/issues/70 Co-authored-by: Hugh Hackman --- .github/workflows/plugin-release.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-release.yaml b/.github/workflows/plugin-release.yaml index fd0b96a..cfc93dd 100644 --- a/.github/workflows/plugin-release.yaml +++ b/.github/workflows/plugin-release.yaml @@ -260,6 +260,12 @@ jobs: --body "$BODY" \ --base main \ --head "release/v${VERSION}" - gh pr merge "release/v${VERSION}" --auto --squash --delete-branch + # Try auto-merge first (works on repos with required status checks pending). + # Fall back to direct squash merge on repos without required status checks + # (auto-merge is rejected when there are no pending required checks to wait for). + if ! gh pr merge "release/v${VERSION}" --auto --squash --delete-branch 2>/dev/null; then + echo "Auto-merge not available (no pending required status checks). Falling back to direct squash merge." + gh pr merge "release/v${VERSION}" --squash --delete-branch + fi env: GH_TOKEN: ${{ steps.app-token.outputs.token }}