You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2024/07/31 12:04:22 UTC

(camel-quarkus) branch main updated: Strip label prefix in auto label workflow before performing GraphQL search query

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 9072aa268b Strip label prefix in auto label workflow before performing GraphQL search query
9072aa268b is described below

commit 9072aa268b3882bc5a48ac1bb9563857ae67dfd0
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Jul 31 09:04:03 2024 +0100

    Strip label prefix in auto label workflow before performing GraphQL search query
---
 .github/workflows/label-issue.yaml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/label-issue.yaml b/.github/workflows/label-issue.yaml
index 7ea2b1369a..ae2fa011e7 100644
--- a/.github/workflows/label-issue.yaml
+++ b/.github/workflows/label-issue.yaml
@@ -134,10 +134,16 @@ jobs:
               }
             }
 
+            // Strip the / prefix as it seems to break GraphQL searches
+            const sanitizedLabels = Array.from(labels).map(label => {
+              const parts = label.split('/');
+              return parts.length > 1 ? parts[1] : parts[0];
+            });
+
             // Check to see if labels already exist, and if not, create them so we can set the color
             const labelQuery = `{
               repository(owner: "${context.repo.owner}", name: "${context.repo.repo}") {
-                labels(first: 50, query: "name: ${Array.from(labels).join(' || ')}") {
+                labels(first: 50, query: "name: ${sanitizedLabels.join(' || ')}") {
                   nodes {
                     name
                   }