Skip to content

Commit 546e58c

Browse files
committed
dev-inf: Fix result extraction from JSONL execution file
The execution_file is in JSONL format with multiple JSON objects. Updated extraction to: 1. Use jq select filter to find the object with type=="result" 2. Extract the .result field from that object 3. Use heredoc format for multiline output in GITHUB_OUTPUT This ensures the full analysis text is passed between stages. Epic: none Release note: none
1 parent 1a39375 commit 546e58c

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/pr-analyzer-threestage.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ jobs:
6767
id: stage1_result
6868
if: steps.stage1.conclusion == 'success'
6969
run: |
70-
RESULT=$(cat "${{ steps.stage1.outputs.execution_file }}" | jq -r '.result' | tail -1)
71-
echo "result=$RESULT" >> $GITHUB_OUTPUT
72-
echo "Stage 1 result: $RESULT"
70+
RESULT=$(jq -r 'select(.type == "result") | .result' "${{ steps.stage1.outputs.execution_file }}")
71+
{
72+
echo 'result<<EOF'
73+
echo "$RESULT"
74+
echo 'EOF'
75+
} >> "$GITHUB_OUTPUT"
76+
echo "Stage 1 result extracted (${#RESULT} characters)"
7377
7478
- name: Stage 2 - Database Expert Review
7579
id: stage2
@@ -114,9 +118,13 @@ jobs:
114118
id: stage2_result
115119
if: steps.stage2.conclusion == 'success'
116120
run: |
117-
RESULT=$(cat "${{ steps.stage2.outputs.execution_file }}" | jq -r '.result' | tail -1)
118-
echo "result=$RESULT" >> $GITHUB_OUTPUT
119-
echo "Stage 2 result: $RESULT"
121+
RESULT=$(jq -r 'select(.type == "result") | .result' "${{ steps.stage2.outputs.execution_file }}")
122+
{
123+
echo 'result<<EOF'
124+
echo "$RESULT"
125+
echo 'EOF'
126+
} >> "$GITHUB_OUTPUT"
127+
echo "Stage 2 result extracted (${#RESULT} characters)"
120128
121129
- name: Stage 3 - Principal Engineer Final Review
122130
id: stage3
@@ -176,9 +184,13 @@ jobs:
176184
id: stage3_result
177185
if: steps.stage3.conclusion == 'success'
178186
run: |
179-
RESULT=$(cat "${{ steps.stage3.outputs.execution_file }}" | jq -r '.result' | tail -1)
180-
echo "result=$RESULT" >> $GITHUB_OUTPUT
181-
echo "Stage 3 result: $RESULT"
187+
RESULT=$(jq -r 'select(.type == "result") | .result' "${{ steps.stage3.outputs.execution_file }}")
188+
{
189+
echo 'result<<EOF'
190+
echo "$RESULT"
191+
echo 'EOF'
192+
} >> "$GITHUB_OUTPUT"
193+
echo "Stage 3 result extracted (${#RESULT} characters)"
182194
183195
- name: Final Analysis Report
184196
if: always()
@@ -225,10 +237,5 @@ jobs:
225237
226238
The three-stage Claude Code analysis has identified potential bug(s) in this PR that may warrant investigation.
227239
228-
**Analysis Results:**
229-
- ⚠️ Stage 1 (Initial Screening): Potential bugs detected
230-
- ⚠️ Stage 2 (Database Expert Review): Potential bugs not ruled out
231-
- ⚠️ Stage 3 (Principal Engineer Review): Potential bugs not ruled out
232-
233240
**Next Steps:**
234241
Please review the detailed findings in the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."

0 commit comments

Comments
 (0)