diff --git a/tools/pull_request_hooks/autoLabel.js b/tools/pull_request_hooks/autoLabel.js index b995bdc19d5..02ed25a2b6c 100644 --- a/tools/pull_request_hooks/autoLabel.js +++ b/tools/pull_request_hooks/autoLabel.js @@ -177,12 +177,11 @@ export async function get_updated_label_set({ github, context }) { const { body = "", diff_url, - labels = [], mergeable, title = "", } = pull_request; - const updated_labels = new Set(labels.map((l) => l.name)); + const updated_labels = new Set(); // Always check file diffs if (diff_url) { @@ -224,6 +223,9 @@ export async function get_updated_label_set({ github, context }) { } } catch (error) { console.error("Error fetching paginated events:", error); + for(const label of pull_request.labels){ + updated_labels.add(label.name); + } } // Always remove Test Merge Candidate