diff --git a/scripts/autolabel.lean b/scripts/autolabel.lean index 020f0ded0b7b10..50d8f350e95241 100644 --- a/scripts/autolabel.lean +++ b/scripts/autolabel.lean @@ -332,7 +332,10 @@ unsafe def main (args : List String): IO UInt32 := do match labels with | #[] => println s!"::warning::no label to add" - | #[label] => + | newLabels => + if newLabels.size > 2 then + println s!"::notice::not adding multiple labels: {labels}" + return 0 match prNumber? with | some n => let labelsPresent ← IO.Process.run { @@ -344,14 +347,12 @@ unsafe def main (args : List String): IO UInt32 := do | [] => -- if the PR does not have a label that this script could add, then we add a label let _ ← IO.Process.run { cmd := "gh", - args := #["pr", "edit", n, "--add-label", label] } - println s!"::notice::added label: {label}" + args := #["pr", "edit", n, "--add-label", s!"\"{",".intercalate newLabels.toList}\""] } + println s!"::notice::added label: {newLabels}" | t_labels_already_present => - println s!"::notice::Did not add label '{label}', since {t_labels_already_present} \ + println s!"::notice::Did not add label '{newLabels}', since {t_labels_already_present} \ were already present" | none => println s!"::warning::no PR-number provided, not adding labels. \ (call `lake exe autolabel 150602` to add the labels to PR `150602`)" - | _ => - println s!"::notice::not adding multiple labels: {labels}" return 0