mirror of
https://github.com/github/spec-kit.git
synced 2026-07-09 08:13:19 +08:00
fix(workflows): match gate reject option case-insensitively (#3335)
`validate` accepts a reject option case-insensitively
(`o.lower() in {"reject", "abort"}`), so a gate authored as
`options: [Approve, Reject]` passes validation. But `execute`
compared the echoed choice case-sensitively, so picking `Reject`
fell through to the approval path and silently ran downstream
steps instead of aborting.
Lower-case `choice` before the reject comparison so the runtime
agrees with the validation that let the option through.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,14 @@ class GateStep(StepBase):
|
||||
choice = self._prompt(self._compose_prompt(message, show_file), options)
|
||||
output["choice"] = choice
|
||||
|
||||
if choice in ("reject", "abort"):
|
||||
# Match rejection case-insensitively. ``_prompt`` echoes the option's
|
||||
# original casing, and ``validate`` accepts a reject option
|
||||
# case-insensitively (``o.lower() in {"reject", "abort"}``), so a gate
|
||||
# authored as ``options: [Approve, Reject]`` passes validation. Comparing
|
||||
# ``choice`` case-sensitively here would then treat a ``Reject`` pick as
|
||||
# approval and silently skip the abort — the reject path must agree with
|
||||
# the check that let the option through.
|
||||
if choice.lower() in ("reject", "abort"):
|
||||
if on_reject == "abort":
|
||||
output["aborted"] = True
|
||||
return StepResult(
|
||||
|
||||
Reference in New Issue
Block a user