ferenc-csaky commented on code in PR #26967:
URL: https://github.com/apache/flink/pull/26967#discussion_r2334130988


##########
.github/workflows/community-review.sh:
##########
@@ -352,6 +415,37 @@ call_github_graphql_api() {
     "https://api.github.com/graphql";
 }
 
+# =============================================================================
+# Check if a label exists in the repository and create it if it doesn't
+# Arguments:
+#   $1 - GitHub API token for authentication
+#   $2 - Label name to check/create
+# =============================================================================
+ensure_label_exists() {
+  local token="${1?missing token}"
+  local label_name="${2?missing label name}"
+  
+  local color="90EE90"
+  
+  # Check if the label exists
+  local label_exists=$(curl --fail --no-progress-meter -s \
+    -H "Accept: application/json" \
+    -H "Authorization: Bearer $token" \
+    "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/labels/$label_name"; \
+    -w "%{http_code}" -o /dev/null || echo "404")
+  
+  # If label doesn't exist (404), create it
+  if [[ "$label_exists" == "404" ]]; then

Review Comment:
   I believe creating the label automatically is reasonable, otherwise this 
would require maintenance every release. We only process `release-` prefixed 
branches in the first place, so I am on board with this logic.



##########
.github/workflows/community-review.sh:
##########
@@ -352,6 +415,37 @@ call_github_graphql_api() {
     "https://api.github.com/graphql";
 }
 
+# =============================================================================
+# Check if a label exists in the repository and create it if it doesn't
+# Arguments:
+#   $1 - GitHub API token for authentication
+#   $2 - Label name to check/create
+# =============================================================================
+ensure_label_exists() {
+  local token="${1?missing token}"
+  local label_name="${2?missing label name}"
+  
+  local color="90EE90"

Review Comment:
   I would suggest a different color for it so it will be obvious that this is 
different than the review labels. Something purplish, I checked the existing 
label and purple is not occupied for anything ATM, so for example `5d069e` 
would be nice.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to