Reject carried-forward receipts by default - #47
Conversation
AAH20
left a comment
There was a problem hiding this comment.
Clean and well-scoped. The core change — inserting a CARRIED_FORWARD check between the API response parse and the set_output calls — is exactly where it belongs.
Key observations:
-
Placement after
VALIDand before outputs — the guard at line ~375 flipsVALID=falseand setsPP_CARRY_FORWARD_DISABLEDonly when all three conditions hold (VALID=true,CARRIED_FORWARD=true, opt-in not enabled). This means a genuinely fresh receipt is never touched, and a failed/denied receipt is never double-errored. -
PP_CARRY_FORWARD_DISABLEDerror-code block — follows the same pattern asSIGNATURE_INVALID/KEY_REVOKED: prints details, callsupsert_pr_comment, exits1. Consistent with the rest of the action. -
README
## Carry-forward approvalssection — good call documenting the version boundary (v2.2.0) so users upgrading know when the behavior changed. -
One nit (non-blocking): the
CARRIED_FORWARDvariable is parsed from the API response with a fallback of"false". If the API ever returns the booleanfalserather than the string"false",jq -rrenders it asfalsewhich matches, so this is fine — just noting for posterity.
LGTM. Approving.
Summary
allow-carry-forwardopt-in for repos that knowingly want PR-level approval carry-forwardWhy
A carried-forward approval can keep the gate green after the PR head changes. Since the action cannot prove which head SHA the prior approval covered, the safer default is to fail closed and require a fresh approval for the current head unless carry-forward is explicitly enabled.
Related: #46
Bounty: #36
Validation
bash -ngit diff --checkPayout
PayPal: jamilurrehman722@gmail.com