From a817b9c1d6514b46c1a6a705d3c67e79c591d223 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 11 Dec 2025 21:56:28 +0000 Subject: [PATCH] fix: correct jq parsing in classify-issue-severity workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The claude-code-action outputs an array of conversation messages, not an object with a 'result' field. This was causing the error: "jq: error: Cannot index array with string 'result'" Updated the extraction logic to: 1. Parse the array of messages 2. Extract text content from message content blocks 3. Get the last text content (the assistant's response) Fixes the error in workflow run: https://github.com/coder/coder/actions/runs/20148520999/job/57835360033 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/classify-issue-severity.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/classify-issue-severity.yml b/.github/workflows/classify-issue-severity.yml index 5ef0f2fd83fc0..0ec0236ab7451 100644 --- a/.github/workflows/classify-issue-severity.yml +++ b/.github/workflows/classify-issue-severity.yml @@ -150,8 +150,14 @@ jobs: exit 1 fi - # Extract the result from the execution file - RESULT=$(jq -r '.result // empty' < "$EXECUTION_FILE") + # The execution file is an array of conversation messages + # Extract the last assistant message's text content + RESULT=$(jq -r '.[].content[]? | select(.type == "text") | .text' < "$EXECUTION_FILE" | tail -n 1) + + if [ -z "$RESULT" ]; then + echo "No text content found in execution file" + exit 1 + fi { echo "result<