Fix SC2012: Replace ls with find in all workflow sources and generated code#7919
Merged
Fix SC2012: Replace ls with find in all workflow sources and generated code#7919
Conversation
- Replace ls -la/lh commands with find -maxdepth 1 -ls - Replace ls with wildcards with find -name pattern - Update bash tool allowlists to use find instead of ls - Update documentation examples to use find - 32 occurrences fixed across 23 workflow files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Replace ls -la in publish_assets.go with find -maxdepth 1 -ls - Replace ls -td in copilot_srt.go with find -printf + sort - Fix ls command in speckit-dispatcher agent file - Regenerate all 126 .lock.yml files with updated commands Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…PATH - Replace ls in claude_engine.go node path detection - Replace ls in codex_engine.go node path detection - Use find + xargs basename for safer directory listing - Regenerate all 126 .lock.yml files - Verify zero SC2012 warnings remain with actionlint Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SC2012 by replacing ls with find in 41 workflows
Fix SC2012: Replace ls with find in all workflow sources and generated code
Dec 27, 2025
pelikhan
approved these changes
Dec 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shellcheck SC2012 warns against parsing
lsoutput due to fragility with special characters in filenames. This PR eliminates all 37 instances across workflow sources and compiler code.Changes
Workflow source files (23 files, 32 occurrences)
ls -la <path>→find <path> -maxdepth 1 -lsls -la dir/*.yml→find dir -name "*.yml" -type ffindequivalents instead oflsCompiler code generation (4 files)
publish_assets.go): Safe output asset directory inspectioncopilot_srt.go): Time-sorted directory finding viafind -printf '%T@ %p\n' | sort -rnclaude_engine.go,codex_engine.go): Changed fromls /opt/hostedtoolcache/node | head -1tofind -maxdepth 1 -type d | head -1 | xargs basenameAgent documentation (1 file)
speckit-dispatcher.agent.mdExample
Before:
ls -la /tmp/gh-aw/safeoutputs/assets/ NODE_BIN_PATH="$(ls /opt/hostedtoolcache/node | head -1)/x64/bin"After:
find /tmp/gh-aw/safeoutputs/assets/ -maxdepth 1 -ls NODE_BIN_PATH="$(find /opt/hostedtoolcache/node -maxdepth 1 -type d | head -1 | xargs basename)/x64/bin"All 126 workflows regenerated. Actionlint confirms zero SC2012 warnings.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login -json GO111MODULE 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 0.1-go1.25.0.linux-amd64/pkg/too-buildtags env -json GO111MODULE 0.1-go1.25.0.linux-amd64/bin/go GOINSECURE GOMOD GOMODCACHE rg/toolchain@v0.0.1-go1.25.0.lin-buildtags(http block)/usr/bin/gh gh api user --jq .login om/nonexistent/repo l/linux_amd64/vet /home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/co--json -json GO111MODULE ux-amd64/pkg/too--show-toplevel /home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linrev-parse -o ference.git -trimpath /usr/bin/git -p main l/linux_amd64/li/tmp/validate-js-1183722102.cjs git(http block)/usr/bin/gh gh api user --jq .login ithub/workflows 3594796/b301/vet.cfg(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.