Skip to content

Commit 7f12520

Browse files
authored
Fix SC2129: Group consecutive shell redirects to same file (#14582)
1 parent bc0f34b commit 7f12520

5 files changed

Lines changed: 52 additions & 32 deletions

File tree

.github/workflows/daily-cli-performance.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ output_file="/tmp/gh-aw/benchmarks/current_metrics.json"
114114
115115
# Initialize JSON
116116
echo "{" > "$output_file"
117-
echo ' "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",' >> "$output_file"
118-
echo ' "date": "'$(date -u +%Y-%m-%d)'",' >> "$output_file"
119-
echo ' "benchmarks": {' >> "$output_file"
117+
{
118+
echo ' "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",'
119+
echo ' "date": "'$(date -u +%Y-%m-%d)'",'
120+
echo ' "benchmarks": {'
121+
} >> "$output_file"
120122
121123
first=true
122124
while IFS= read -r line; do
@@ -135,18 +137,22 @@ while IFS= read -r line; do
135137
fi
136138
137139
# Write benchmark entry
138-
echo -n " \"$name\": {" >> "$output_file"
139-
echo -n "\"ns_per_op\": $ns_per_op, " >> "$output_file"
140-
echo -n "\"bytes_per_op\": $bytes_per_op, " >> "$output_file"
141-
echo -n "\"allocs_per_op\": $allocs_per_op, " >> "$output_file"
142-
echo -n "\"iterations\": $iterations" >> "$output_file"
143-
echo -n "}" >> "$output_file"
140+
{
141+
echo -n " \"$name\": {"
142+
echo -n "\"ns_per_op\": $ns_per_op, "
143+
echo -n "\"bytes_per_op\": $bytes_per_op, "
144+
echo -n "\"allocs_per_op\": $allocs_per_op, "
145+
echo -n "\"iterations\": $iterations"
146+
echo -n "}"
147+
} >> "$output_file"
144148
fi
145149
done < "$results_file"
146150
147-
echo "" >> "$output_file"
148-
echo " }" >> "$output_file"
149-
echo "}" >> "$output_file"
151+
{
152+
echo ""
153+
echo " }"
154+
echo "}"
155+
} >> "$output_file"
150156
151157
echo "Parsed benchmark results to $output_file"
152158
cat "$output_file"
@@ -173,8 +179,10 @@ if [ ! -f /tmp/gh-aw/repo-memory/default/benchmark_history.jsonl ]; then
173179
fi
174180

175181
# Append current results to history
176-
cat /tmp/gh-aw/benchmarks/current_metrics.json >> /tmp/gh-aw/repo-memory/default/benchmark_history.jsonl
177-
echo "" >> /tmp/gh-aw/repo-memory/default/benchmark_history.jsonl
182+
{
183+
cat /tmp/gh-aw/benchmarks/current_metrics.json
184+
echo ""
185+
} >> /tmp/gh-aw/repo-memory/default/benchmark_history.jsonl
178186

179187
echo "Historical data updated"
180188
```

.github/workflows/hourly-ci-cleaner.lock.yml

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/hourly-ci-cleaner.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,19 @@ jobs:
6969
echo "Run ID: ${RUN_ID}"
7070
7171
# Set outputs for use in other jobs
72-
echo "ci_status=${CONCLUSION}" >> "$GITHUB_OUTPUT"
73-
echo "ci_run_id=${RUN_ID}" >> "$GITHUB_OUTPUT"
72+
{
73+
echo "ci_status=${CONCLUSION}"
74+
echo "ci_run_id=${RUN_ID}"
75+
} >> "$GITHUB_OUTPUT"
7476
7577
if [ "$CONCLUSION" = "success" ]; then
7678
echo "✅ CI is passing on main branch - no action needed" >> "$GITHUB_STEP_SUMMARY"
7779
echo "ci_needs_fix=false" >> "$GITHUB_OUTPUT"
7880
else
79-
echo "❌ CI is failing on main branch - agent will attempt to fix" >> "$GITHUB_STEP_SUMMARY"
80-
echo "Run ID: ${RUN_ID}" >> "$GITHUB_STEP_SUMMARY"
81+
{
82+
echo "❌ CI is failing on main branch - agent will attempt to fix"
83+
echo "Run ID: ${RUN_ID}"
84+
} >> "$GITHUB_STEP_SUMMARY"
8185
echo "ci_needs_fix=true" >> "$GITHUB_OUTPUT"
8286
fi
8387
steps:

.github/workflows/smoke-copilot.lock.yml

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/smoke-copilot.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ safe-outputs:
8181
if [ -f "$GH_AW_AGENT_OUTPUT" ]; then
8282
MESSAGE=$(cat "$GH_AW_AGENT_OUTPUT" | jq -r '.items[] | select(.type == "send_slack_message") | .message')
8383
echo "Would send to Slack: $MESSAGE"
84-
echo "### 📨 Slack Message Stub" >> "$GITHUB_STEP_SUMMARY"
85-
echo "**Message:** $MESSAGE" >> "$GITHUB_STEP_SUMMARY"
86-
echo "" >> "$GITHUB_STEP_SUMMARY"
87-
echo "> ℹ️ This is a stub for testing purposes. No actual Slack message is sent." >> "$GITHUB_STEP_SUMMARY"
84+
{
85+
echo "### 📨 Slack Message Stub"
86+
echo "**Message:** $MESSAGE"
87+
echo ""
88+
echo "> ℹ️ This is a stub for testing purposes. No actual Slack message is sent."
89+
} >> "$GITHUB_STEP_SUMMARY"
8890
else
8991
echo "No agent output found"
9092
fi

0 commit comments

Comments
 (0)