From 4ff1a9fcfccbbe2bc5829845b1f3b4c45989fda4 Mon Sep 17 00:00:00 2001 From: Urgau Date: Fri, 13 Sep 2024 13:28:35 +0200 Subject: [PATCH] Copy over labels to the relnote tracking issue --- src/handlers/relnotes.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/handlers/relnotes.rs b/src/handlers/relnotes.rs index be1cf470..ba87d521 100644 --- a/src/handlers/relnotes.rs +++ b/src/handlers/relnotes.rs @@ -116,7 +116,18 @@ cc {} -- origin issue/PR authors and assignees for starting to draft text &e.issue.repository(), &title, &body, - vec!["relnotes".to_owned(), "relnotes-tracking-issue".to_owned()], + ["relnotes", "relnotes-tracking-issue"] + .into_iter() + .chain(e.issue.labels.iter().map(|l| &*l.name).filter(|l| { + l.starts_with("A-") // A-* (area) + || l.starts_with("F-") // F-* (feature) + || l.starts_with("L-") // L-* (lint) + || l.starts_with("O-") // O-* (OS) + || l.starts_with("T-") // T-* (team) + || l.starts_with("WG-") // WG-* (working group) + })) + .map(ToOwned::to_owned) + .collect::>(), ) .await?; if let Some(milestone) = &e.issue.milestone {