This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 695d177e98 Fix auto label workflow prematurely removing user added 
issue labels
695d177e98 is described below

commit 695d177e98cbbb72f99be0a4984e5c23fc80812d
Author: James Netherton <[email protected]>
AuthorDate: Wed Oct 29 13:12:33 2025 +0000

    Fix auto label workflow prematurely removing user added issue labels
---
 .github/workflows/label-issue.yaml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/label-issue.yaml 
b/.github/workflows/label-issue.yaml
index 94adb5883c..8d2f90dbed 100644
--- a/.github/workflows/label-issue.yaml
+++ b/.github/workflows/label-issue.yaml
@@ -121,8 +121,16 @@ jobs:
               .forEach(prefix => prefixes.add(prefix));
 
             const prefixRegex = Array.from(prefixes).join('|');
+            const labelFilter = (label) => {
+                // Avoid removing user added labels on issue open or reopen
+                if (context.payload.action !== 'opened' && 
context.payload.action !== 'reopened') {
+                  return label.name.match("^(?!" + prefixRegex + ").*");
+                }
+                return true;
+            };
+
             issue.labels
-              .filter(label => label.name.match("^(?!" + prefixRegex + ").*"))
+              .filter(labelFilter)
               .map(label => label.name)
               .forEach(label => labels.add(label));
 

Reply via email to