-
Notifications
You must be signed in to change notification settings - Fork 308
Description
Description
Static analysis identified 164 instances of SC2129 shellcheck warnings across workflow files. This style issue occurs when multiple consecutive commands redirect to the same file individually, rather than grouping them with { cmd1; cmd2; } >> file pattern.
While this is a style issue (not a security vulnerability), fixing it improves code quality and reduces shellcheck noise.
Current Pattern
echo "key1=value1" >> $GITHUB_OUTPUT
echo "key2=value2" >> $GITHUB_OUTPUT
echo "key3=value3" >> $GITHUB_OUTPUTRecommended Pattern
{
echo "key1=value1"
echo "key2=value2"
echo "key3=value3"
} >> $GITHUB_OUTPUTScope
- Total instances: 164 across 148 workflow files
- Pattern: Consecutive redirects to
$GITHUB_OUTPUT,$GITHUB_STEP_SUMMARY,$GITHUB_ENV - Files affected:
.github/workflows/*.mdsource files (not.lock.ymlfiles)
Suggested Changes
-
Identify affected workflows: Use grep to find all instances:
grep -r ">> \$GITHUB_OUTPUT" .github/workflows/*.md grep -r ">> \$GITHUB_STEP_SUMMARY" .github/workflows/*.md
-
Fix pattern: Group consecutive redirects to same file
- Look for 2+ consecutive echo/printf statements to same file
- Wrap them in
{ ...; } >> fileblock
-
Recompile workflows: Run
make recompileto regenerate.lock.ymlfiles -
Validate: Run
make lintto ensure shellcheck warnings are resolved
Files Affected
Multiple workflow files in .github/workflows/ (estimated 50-60 files based on 164 instances)
Examples from previous fixes:
.github/workflows/hourly-ci-cleaner.md(lines 72-77).github/workflows/smoke-copilot.md(lines 84-89)
Success Criteria
- All SC2129 shellcheck warnings resolved (164 → 0)
- Workflows recompiled with
make recompile -
make lintpasses without SC2129 warnings - No functional changes to workflow behavior
Automation Opportunity
Consider creating a script to automatically detect and fix this pattern:
# Detect pattern: 2+ consecutive lines with same redirect
# Transform: wrap in { ...; } >> file block
# Apply: to all .md files in .github/workflows/Source
Extracted from Static Analysis Report - February 8, 2026 (Discussion #14568)
Priority
Low - Style improvement, not blocking, but reduces linting noise significantly
Estimated Effort
- Manual fix: 2-3 days to review and fix 164 instances
- Automated fix: 1 day to create script + validation
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 10, 2026, 5:27 AM UTC