fix: scan all dirs when script_dirs has multiple entries - #82
Open
fedemaleh wants to merge 1 commit into
Open
Conversation
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.
Summary
The reusable
shellcheckworkflow documentsscript_dirsas "Space-separated dirs/files to scan", but the implementation runsfind "$SCRIPT_DIRS"with the variable quoted — so a multi-dir value likeentrypoint scriptsis treated as a single path (entrypoint scripts), which doesn't exist.findthen errors and shellcheck runs with no files:Any caller passing more than one dir/file hits this. A single-dir value works, which is why it went unnoticed.
Fix
Split the space-separated value into an array and pass each element as a distinct
findargument, so the documented contract works while keeping each path quoted:No change to the empty-input branch or to the
env:-based input handling (no injection surface added).Test plan
script_dirs: scripts) — still works.script_dirs: entrypoint scripts) — now scans both (previously errored with exit 123).script_dirs— unchanged (recursive*.sh).Context
Found while adding PR checks to
nullplatform/application-lifecycle-manager, which passesscript_dirs: entrypoint scripts. That repo currently works around this by calling the reusable workflow once per directory; this fix lets callers pass the space-separated list as documented.