From f055d399d7c7ce9233d63471808b21787423a969 Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Tue, 2 Jul 2024 17:34:12 -0500 Subject: [PATCH] check for existence of `removed_label` on closed PR --- dist/index.js | 12 +++++++++--- src/index.js | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 41ce623..8d262f3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36950,9 +36950,15 @@ try { (label) => label.name === value.label, ); } else if (value.removed_label) { - matches = !prEvent.pull_request.labels.some( - (label) => label.name === value.removed_label, - ); + if (prEvent.action !== "closed") { + matches = !prEvent.pull_request.labels.some( + (label) => label.name === value.removed_label, + ); + } else { + matches = prEvent.pull_request.labels.some( + (label) => label.name === value.removed_label, + ); + } } if (matches) { patterns = ref; diff --git a/src/index.js b/src/index.js index 4cae47e..ce75712 100644 --- a/src/index.js +++ b/src/index.js @@ -37,9 +37,15 @@ try { (label) => label.name === value.label, ); } else if (value.removed_label) { - matches = !prEvent.pull_request.labels.some( - (label) => label.name === value.removed_label, - ); + if (prEvent.action !== "closed") { + matches = !prEvent.pull_request.labels.some( + (label) => label.name === value.removed_label, + ); + } else { + matches = prEvent.pull_request.labels.some( + (label) => label.name === value.removed_label, + ); + } } if (matches) { patterns = ref;