From 653591fdf07d534ddea35903b2b7751a1cf8ec53 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:04:28 +0000 Subject: [PATCH 1/2] Initial plan From 757598fe5073f2f699c62c4f0b11c7450d8e6bec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:08:23 +0000 Subject: [PATCH 2/2] Fix jq error handling in add-files-changed-label workflow Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com> --- .github/workflows/add-files-changed-label.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-files-changed-label.yml b/.github/workflows/add-files-changed-label.yml index e37862eba8..8b0dace381 100644 --- a/.github/workflows/add-files-changed-label.yml +++ b/.github/workflows/add-files-changed-label.yml @@ -84,7 +84,13 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/labels") - ALL_REPO_LABELS=$(echo "$ALL_LABELS_RESPONSE" | jq -r '.[].name') + # Check if the API request was successful before processing + if echo "$ALL_LABELS_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then + ALL_REPO_LABELS=$(echo "$ALL_LABELS_RESPONSE" | jq -r '.[].name') + else + echo "Error: Could not fetch repository labels. Response: $ALL_LABELS_RESPONSE" + exit 1 + fi # Create the label if it doesn't exist if ! echo "$ALL_REPO_LABELS" | grep -q "$LABEL"; then @@ -118,7 +124,13 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/issues/$PR_NUMBER/labels") - EXISTING_LABELS=$(echo "$PR_LABELS_RESPONSE" | jq -r '.[].name') + # Check if the API request was successful before processing + if echo "$PR_LABELS_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then + EXISTING_LABELS=$(echo "$PR_LABELS_RESPONSE" | jq -r '.[].name') + else + echo "Error: Could not fetch PR labels. Response: $PR_LABELS_RESPONSE" + exit 1 + fi # Remove any existing files-changed labels echo "Checking for existing 'files-changed' labels to remove..."