Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions .github/workflows/classify-issue-severity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1.0.23
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: --json-schema '{"type":"object","properties":{"status":{"type":"string","enum":["classified","insufficient_info"]},"severity":{"type":"string","enum":["s0","s1","s2","s3","s4"]},"reasoning":{"type":"string"},"next_steps":{"type":"array","items":{"type":"string"}}},"required":["status","reasoning"],"allOf":[{"if":{"properties":{"status":{"const":"classified"}}},"then":{"required":["severity"]}},{"if":{"properties":{"status":{"const":"insufficient_info"}}},"then":{"required":["next_steps"]}}]}'
prompt: |
You are an expert software engineer triaging customer-reported issues for Coder, a cloud development environment platform.

Expand Down Expand Up @@ -140,28 +141,20 @@ jobs:

**Critical**: Output ONLY the JSON object, nothing else. The JSON will be parsed and validated.

- name: Extract Result from Execution File
- name: Extract Result from Structured Output
id: extract
env:
EXECUTION_FILE: ${{ steps.analysis.outputs.execution_file }} # zizmor: ignore[template-injection]
STRUCTURED_OUTPUT: ${{ steps.analysis.outputs.structured_output }}
run: |
if [ ! -f "$EXECUTION_FILE" ]; then
echo "Execution file not found: $EXECUTION_FILE"
exit 1
fi

# 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"
if [ -z "$STRUCTURED_OUTPUT" ]; then
echo "No structured output returned from Claude"
exit 1
fi

# The structured_output is already in JSON format matching our schema
{
echo "result<<EOF"
echo "$RESULT"
echo "$STRUCTURED_OUTPUT"
echo "EOF"
} >> "$GITHUB_OUTPUT"

Expand Down
Loading