Skip to content

Commit

Permalink
chore: sanitize test log names before uploading (#1766)
Browse files Browse the repository at this point in the history
* sanitize test log names before uploading

* sanitize only if needed

* prepare for pr

---------

Co-authored-by: Sasha <[email protected]>
  • Loading branch information
fbarbu15 and weboko authored Dec 21, 2023
1 parent 9014de8 commit 6dc3882
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ jobs:
name: ${{ inputs.test_type }}-debug.log
path: debug.log

- name: Sanitize log filenames
if: failure()
run: |
find packages/tests/log/ -type f | while read fname; do
dir=$(dirname "$fname")
base=$(basename "$fname")
sanitized_base=$(echo $base | tr -d '\"*:<>?|' | sed 's/[\\/\r\n]/_/g' | sed 's/_$//')
if [ "$base" != "$sanitized_base" ]; then
mv "$fname" "$dir/$sanitized_base"
fi
done
- name: Upload logs on failure
uses: actions/upload-artifact@v3
if: failure()
Expand Down

0 comments on commit 6dc3882

Please sign in to comment.