Skip to content

Commit f25b109

Browse files
fjammesclaude
andcommitted
Fix GitHub Actions workflow to use Python yq instead of Mike Farah yq
Update dispatch.yaml workflow to use Python-based yq (jq-compatible syntax) instead of Mike Farah's yq. This fixes the "Unable to parse steps" issue in E2E test report processing by using consistent yq syntax across environments. Changes: - Install python3-pip and yq via pip instead of downloading binary - Remove 'e' flag from yq commands (Mike Farah syntax -> Python syntax) - Add tr -d '"' to clean quoted output from Python yq 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6c55d18 commit f25b109

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/dispatch.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
steps:
1111
- name: Install yq
1212
run: |
13-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
14-
sudo chmod +x /usr/local/bin/yq
13+
sudo apt-get update && sudo apt-get install -y python3-pip
14+
pip3 install yq
1515
1616
- name: Display test metadata
1717
run: |
@@ -74,24 +74,24 @@ jobs:
7474
# Extract general info using yq (if available) or basic grep/awk
7575
if command -v yq >/dev/null 2>&1; then
7676
echo "📍 Test Run Info:"
77-
echo " Start time: $(yq e '.test_run.start_time' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
78-
echo " Runner: $(yq e '.test_run.runner' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
79-
echo " OS: $(yq e '.environment.os' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
80-
echo " Architecture: $(yq e '.environment.arch' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
77+
echo " Start time: $(yq '.test_run.start_time' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
78+
echo " Runner: $(yq '.test_run.runner' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
79+
echo " OS: $(yq '.environment.os' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
80+
echo " Architecture: $(yq '.environment.arch' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
8181
8282
echo ""
8383
echo "🏁 Test Summary:"
84-
echo " End time: $(yq e '.summary.end_time' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
85-
echo " Duration: $(yq e '.summary.duration_seconds' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A') seconds"
86-
echo " Overall status: $(yq e '.summary.overall_status' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
87-
echo " Success rate: $(yq e '.summary.success_rate' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
88-
echo " Total steps: $(yq e '.summary.total_steps' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
89-
echo " Passed steps: $(yq e '.summary.passed_steps' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
90-
echo " Failed steps: $(yq e '.summary.failed_steps' test-artifacts/$REPORT_FILE 2>/dev/null || echo 'N/A')"
84+
echo " End time: $(yq '.summary.end_time' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
85+
echo " Duration: $(yq '.summary.duration_seconds' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A') seconds"
86+
echo " Overall status: $(yq '.summary.overall_status' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
87+
echo " Success rate: $(yq '.summary.success_rate' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
88+
echo " Total steps: $(yq '.summary.total_steps' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
89+
echo " Passed steps: $(yq '.summary.passed_steps' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
90+
echo " Failed steps: $(yq '.summary.failed_steps' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo 'N/A')"
9191
9292
echo ""
9393
echo "📋 Test Steps:"
94-
yq e '.steps[] | " " + .phase + ": " + .status + " (" + .timestamp + ")"' test-artifacts/$REPORT_FILE 2>/dev/null || echo " Unable to parse steps"
94+
yq '.steps[] | " " + .phase + ": " + .status + " (" + .timestamp + ")"' test-artifacts/$REPORT_FILE 2>/dev/null | tr -d '"' || echo " Unable to parse steps"
9595
else
9696
echo "⚠️ yq not available, showing raw summary info"
9797
grep -A 10 "summary:" test-artifacts/$REPORT_FILE || echo " Unable to extract summary"

0 commit comments

Comments
 (0)