deploy-gate icon indicating copy to clipboard operation
deploy-gate copied to clipboard

Bug: re-run bypasses receipt verification — skips PP API entirely

Open cgoldber82 opened this issue 8 months ago • 2 comments

Bug

When a PR Gate workflow is re-run via gh run rerun, the action takes a different code path that only checks protected paths and exits with success — without ever calling the PP verify API. This means re-runs bypass Permission Protocol approval entirely.

Reproduction

  1. PR opens → Deploy Gate runs → creates deploy request → exits 1 (expected)
  2. Request expires (1h production TTL)
  3. gh run rerun <run_id>
  4. Action succeeds with ✅ No protected paths changed - merge allowed
  5. No PP API call made, no new deploy request created
  6. PR checks go green without any PP approval

Expected Behavior

Re-runs should call the PP verify API just like the original run. If no receipt exists, a new deploy request should be created.

Evidence

Re-run logs show only:

✅ No protected paths changed - merge allowed

No API response status, no Resolved company, no Request ID — the entire PP verification block was skipped.

Root Cause (Suspected)

The action likely has conditional logic that short-circuits when certain conditions are met on re-run (different event context, missing PR metadata, or a cached result). The protected paths check runs but the receipt verification doesn't.

Impact

Security: Any PR can bypass PP approval by simply re-running the failed Action. This defeats the entire purpose of the deploy gate.

cgoldber82 avatar Mar 11 '26 19:03 cgoldber82

Root cause found: The v1 tag pointed to an old version that had a 3-step flow:

  1. Check protected paths
  2. Verify PP Receipt (only if protected paths changed)
  3. Skip with success (if no protected paths changed)

This meant any PR without changes to deploy/ or .github/workflows/ bypassed PP verification entirely.

Fix: Force-updated v1 tag to point to main (5449384) which always runs PP verification regardless of protected paths. Re-triggered all 5 site PR workflows.

cgoldber82 avatar Mar 11 '26 19:03 cgoldber82

This bug existed in the pre-v2 action (Phase 0) which had a two-step flow: check protected paths → only verify receipt if protected paths changed. The 'Skip (No protected paths)' step would set a success commit status and exit without calling the PP API.

This was removed in v2 (commit 58be964 — 'feat: v2 — gate every PR, fail-open, PR comments'). The current action (v1 tag @ 5449384, which includes v2) always calls the PP verify API regardless of whether protected paths changed. The protected-paths input is now metadata-only, sent to the API for risk assessment but never used for gating.

All consumer workflows (app, site, deploy-gate) reference @v1, which includes the fix.

rodchalski avatar Mar 15 '26 20:03 rodchalski