Skip to content

Commit be9cb44

Browse files
fix(merge-guard): bind --match-head-commit to close the dropped-constraint case (#1042)
Add --match-head-commit (value-taking) to the merge denylist. An approval carrying --match-head-commit <sha> that is then executed without it now REFUSES via set-equality on the bound flag, closing the silent head-SHA-constraint drop.
1 parent 454ca54 commit be9cb44

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pact-plugin/hooks/shared/merge_guard_common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ def _extract_force_push_target_ref(command: str) -> str | None:
472472
"--admin": (("--admin",), False), # bypass branch protection
473473
"--delete-branch": (("-d", "--delete-branch"), False), # side-effect: deletes source branch
474474
"--repo": (("-R", "--repo"), True), # cross-repo redirect (value-carrying target)
475+
# value-carrying SAFETY constraint (pins the merge to a head SHA); binding
476+
# it closes the dropped-constraint case — approve with --match-head-commit,
477+
# execute without it -> set-equality REFUSES (#1042).
478+
"--match-head-commit": (("--match-head-commit",), True),
475479
},
476480
"close": {
477481
"--repo": (("-R", "--repo"), True), # cross-repo redirect (value-carrying target)

0 commit comments

Comments
 (0)