Skip to content

Commit a817b9c

Browse files
david-fraleyclaude
andcommitted
fix: correct jq parsing in classify-issue-severity workflow
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 <noreply@anthropic.com>
1 parent f45a179 commit a817b9c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/classify-issue-severity.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,14 @@ jobs:
150150
exit 1
151151
fi
152152
153-
# Extract the result from the execution file
154-
RESULT=$(jq -r '.result // empty' < "$EXECUTION_FILE")
153+
# The execution file is an array of conversation messages
154+
# Extract the last assistant message's text content
155+
RESULT=$(jq -r '.[].content[]? | select(.type == "text") | .text' < "$EXECUTION_FILE" | tail -n 1)
156+
157+
if [ -z "$RESULT" ]; then
158+
echo "No text content found in execution file"
159+
exit 1
160+
fi
155161
156162
{
157163
echo "result<<EOF"

0 commit comments

Comments
 (0)