Skip to content

Commit c5b0fc5

Browse files
committed
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.
1 parent d8184e4 commit c5b0fc5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/auto-approve.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ permissions:
1212
jobs:
1313
approve:
1414
runs-on: ubuntu-latest
15-
if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target'
15+
# Opt-in: a bot approval can satisfy branch protection's required review,
16+
# so auto-approval only runs where a maintainer sets SHADOW_AUTO_APPROVE=true.
17+
if: >-
18+
vars.SHADOW_AUTO_APPROVE == 'true' &&
19+
(github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target')
1620
timeout-minutes: 2
1721

1822
steps:

0 commit comments

Comments
 (0)