Skip to content

ci: gate auto-approve behind SHADOW_AUTO_APPROVE (off by default)#285

Merged
sudsali merged 1 commit into
masterfrom
ci/gate-auto-approve
Jul 21, 2026
Merged

ci: gate auto-approve behind SHADOW_AUTO_APPROVE (off by default)#285
sudsali merged 1 commit into
masterfrom
ci/gate-auto-approve

Conversation

@sudsali

@sudsali sudsali commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Gates the auto-approve workflow behind a new repo/org variable SHADOW_AUTO_APPROVE, defaulting to off. Auto-approval now runs only where a maintainer has explicitly set SHADOW_AUTO_APPROVE=true.

Why

An AppSec review of the Shadow bot flagged that the bot's APPROVE review can satisfy branch protection's required approving review (all repos require 1, bot not excluded). That means a PR whose findings were suppressed — e.g. via prompt injection in the diff — could be auto-approved and satisfy the human-review gate.

Making auto-approval opt-in (off by default) keeps a human approval on the critical path unless a maintainer deliberately enables it. The bot is comment-only in the default configuration.

Change

One line: the approve job if: now additionally requires vars.SHADOW_AUTO_APPROVE == 'true'. The existing event guard (pull_request / pull_request_target) is preserved. No engine change.

Note

Touches .github/, so per the auto-approve Condition-0 guard this PR itself requires human approval + merge.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.


Generated by AI (model: us.anthropic.claude-opus-4-8, prompt: 295226dd) — may not be fully accurate. Reply if this doesn't help.
Reviewed by Shadow · github.com/sudsali/shadow

@sudsali
sudsali force-pushed the ci/gate-auto-approve branch from 12456ff to c5b0fc5 Compare July 21, 2026 15:44

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.


Generated by AI (model: us.anthropic.claude-opus-4-8, prompt: 295226dd) — may not be fully accurate. Reply if this doesn't help.
Reviewed by Shadow · github.com/sudsali/shadow

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.
@sudsali
sudsali force-pushed the ci/gate-auto-approve branch from c5b0fc5 to 9193e5a Compare July 21, 2026 15:46

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.


Generated by AI (model: us.anthropic.claude-opus-4-8, prompt: 295226dd) — may not be fully accurate. Reply if this doesn't help.
Reviewed by Shadow · github.com/sudsali/shadow

@SamPom100 SamPom100 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sudsali
sudsali merged commit 193cd98 into master Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants