Skip to content

Commit 6dc3882

Browse files
fbarbu15weboko
andauthored
chore: sanitize test log names before uploading (#1766)
* sanitize test log names before uploading * sanitize only if needed * prepare for pr --------- Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
1 parent 9014de8 commit 6dc3882

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/test-node.yml

+12
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ jobs:
9191
name: ${{ inputs.test_type }}-debug.log
9292
path: debug.log
9393

94+
- name: Sanitize log filenames
95+
if: failure()
96+
run: |
97+
find packages/tests/log/ -type f | while read fname; do
98+
dir=$(dirname "$fname")
99+
base=$(basename "$fname")
100+
sanitized_base=$(echo $base | tr -d '\"*:<>?|' | sed 's/[\\/\r\n]/_/g' | sed 's/_$//')
101+
if [ "$base" != "$sanitized_base" ]; then
102+
mv "$fname" "$dir/$sanitized_base"
103+
fi
104+
done
105+
94106
- name: Upload logs on failure
95107
uses: actions/upload-artifact@v3
96108
if: failure()

0 commit comments

Comments
 (0)