-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Spaces in file names are not handled correctly #216
Comments
Thanks for reporting this issue. |
I'll strongly discourage use of spaces in the file names as leads to more errors down the line. bash loops by default rely on spaces as the Internal field separator and might result in bugs like for file in embeds/general 412874536418279426/read-me-1 899830563651854336.json Test 1/Test 1.json
do
echo "$file"
done Which prints out
But we should be able to support this use case. |
I appreciate it, thanks. |
Correct, It's a known limitation and that file was created for testing and future support of file names with spaces. |
Hi Is this patch in 11.2? I am getting an error here trying to run some tests against a checkin with 1 or 2 files that each contain spaces:
If I use (Apols for the naive question, I am a bit out of my depth...!) |
@psychemedia No worries, you can use - id: changed-files
uses: tj-actions/changed-files@v11.2
with:
separator: ","
files: |
.ipynb$
For example, you'll need to use ...
- name: List all modified files
run: |
IFS=$',' read -a MODIFIED_FILES_ARRAY <<< "${{ steps.changed-files-comma.outputs.modified_files }}"
for file in "${MODIFIED_FILES_ARRAY[@]}"; do
echo $file
done
shell:
bash See this PR for more information. |
It requires discipline but shell scripting does support whitespace in filenames just fine: Shellcheck catches 99.99% missing quotes: https://github.com/koalaman/shellcheck/wiki/SC2046
Only loops "buggy by default". Fix: - for file in embeds/general 412874536418279426/read-me-1 899830563651854336.json Test 1/Test 1.json
+ for file in embeds/general 412874536418279426/read-me-1 899830563651854336.json 'Test 1/Test 1.json' |
Is there an existing issue for this?
Describe the bug?
If you have spaces in your file names and you provide a custom separator (eg. separator: ",") all spaces are replaced by the separator and the results sorted.
To Reproduce
embeds/general 412874536418279426/read-me-1 899830563651854336.json
Test 1/Test 1.json
1.json,1/Test,412874536418279426/read-me-1,899830563651854336.json,Test,embeds/general
What OS are you seeing the problem on?
ubuntu-latest or ubuntu-20.04
Expected behavior?
I expect:
embeds/general 412874536418279426/read-me-1 899830563651854336.json,Test 2/Test 1.json
Relevant log output
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: