Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions scripts/autolabel.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Loading