Skip to content

Commit d0317c9

Browse files
avrabeclaude
andcommitted
fix: suppress Bazel logs in checksum updater workflow JSON output
The workflow was redirecting both stderr and stdout to the JSON results file, causing Bazel INFO logs to be included in the JSON, making it unparseable by jq. Fix: Use 'tail -n 1' to capture only the final JSON line from the output, which is the actual result from the checksum updater tool. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent abc8ec8 commit d0317c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/weekly-checksum-update.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ jobs:
9393
9494
echo "Running checksum updater with tools: $TOOLS"
9595
96-
# Run the updater and capture output
96+
# Run the updater and capture output (stderr to stdout is visible, stdout to file for JSON parsing)
9797
if [ "$TOOLS" = "all" ]; then
98-
bazel run //tools/checksum_updater:checksum_updater_bin -- update-all $FORCE_FLAG $DRY_RUN_FLAG --output-format json > update_results.json
98+
bazel run //tools/checksum_updater:checksum_updater_bin -- update-all $FORCE_FLAG $DRY_RUN_FLAG --output-format json 2>&1 | tail -n 1 > update_results.json
9999
else
100-
bazel run //tools/checksum_updater:checksum_updater_bin -- update --tools "$TOOLS" $FORCE_FLAG $DRY_RUN_FLAG --output-format json > update_results.json
100+
bazel run //tools/checksum_updater:checksum_updater_bin -- update --tools "$TOOLS" $FORCE_FLAG $DRY_RUN_FLAG --output-format json 2>&1 | tail -n 1 > update_results.json
101101
fi
102102
103103
# Check if any updates were made
@@ -112,8 +112,8 @@ jobs:
112112
# Store results for later steps
113113
cp update_results.json ./update_results.json
114114
115-
# Generate summary for PR description
116-
bazel run //tools/checksum_updater:checksum_updater_bin -- generate-summary update_results.json > ./update_summary.md
115+
# Generate summary for PR description (suppress Bazel logs, keep only command output)
116+
bazel run //tools/checksum_updater:checksum_updater_bin -- generate-summary update_results.json 2>&1 | tail -n +1 | grep -v "^INFO\|^WARN\|^ERROR\|^Computing\|^Loading\|^Analyzing\|^Target\|^INFO:" > ./update_summary.md || true
117117
118118
- name: Validate updated checksums
119119
if: steps.update.outputs.updates_count > 0

0 commit comments

Comments
 (0)