Objective
Fix 72 occurrences of shellcheck SC2012 info-level issues across 41 workflows by replacing ls parsing with find commands for more robust filename handling.
Problem
Using ls output in scripts can fail with special characters in filenames (spaces, newlines, etc.):
ls -t *.yml | head -5 # ❌ Breaks with spaces/special chars
Solution
Use find with proper formatting:
find . -name "*.yml" -type f -printf '%T@ %p\n' | sort -rn | head -5 | cut -d' ' -f2
Impact
While info-level, this improves robustness when:
- Filenames contain spaces or special characters
- Operating in directories with varied file naming conventions
- Processing user-generated or external files
Approach
- Identify all
ls usage patterns in workflow .md files
- Determine the intent of each
ls command (sorting, filtering, etc.)
- Replace with equivalent
find commands
- Test locally if possible for common patterns
- Recompile workflows:
make recompile
- Verify with actionlint
Common Patterns to Fix
# Pattern 1: List by time
ls -t pattern | head -n → find + sort + head
# Pattern 2: List all files
ls pattern → find -name pattern
# Pattern 3: List with size
ls -lh pattern → find -printf with custom format
Files to Modify
41 workflow .md files in .github/workflows/ (72 total occurrences)
Acceptance Criteria
AI generated by Plan Command for discussion #7889
Objective
Fix 72 occurrences of shellcheck SC2012 info-level issues across 41 workflows by replacing
lsparsing withfindcommands for more robust filename handling.Problem
Using
lsoutput in scripts can fail with special characters in filenames (spaces, newlines, etc.):Solution
Use
findwith proper formatting:Impact
While info-level, this improves robustness when:
Approach
lsusage patterns in workflow.mdfileslscommand (sorting, filtering, etc.)findcommandsmake recompileCommon Patterns to Fix
Files to Modify
41 workflow
.mdfiles in.github/workflows/(72 total occurrences)Acceptance Criteria
actionlintshows 0 SC2012 issuesRelated to [plan] Address static analysis findings from actionlint/shellcheck #7896