From 9193e5a8576d019ef8aa3d81e918713595132683 Mon Sep 17 00:00:00 2001 From: Sudhanshu Sali Date: Mon, 20 Jul 2026 14:50:19 -0400 Subject: [PATCH] ci: gate auto-approve behind SHADOW_AUTO_APPROVE (off by default) Auto-approval now runs only where a maintainer has explicitly set the repo/org variable SHADOW_AUTO_APPROVE=true. Default is off, so the bot is comment-only unless deliberately enabled. Rationale: a bot APPROVE review can satisfy branch protection's required approving review. Making auto-approval opt-in keeps a human approval on the critical path by default, addressing the AppSec review finding that the bot could otherwise rubber-stamp a PR whose findings were suppressed via prompt injection. The event guard (pull_request / pull_request_target) is unchanged. --- .github/workflows/auto-approve.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 9115d83..0118355 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -12,7 +12,9 @@ permissions: jobs: approve: runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target' + # Opt-in: a bot approval can satisfy branch protection's required review, + # so auto-approval only runs where a maintainer sets SHADOW_AUTO_APPROVE=true. + if: vars.SHADOW_AUTO_APPROVE == 'true' && (github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target') timeout-minutes: 2 steps: