Validate SVG logos
This commit is contained in:
parent
6ee38e6628
commit
557420075f
19
.github/workflows/validate-logos.yml
vendored
Normal file
19
.github/workflows/validate-logos.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: SVG Check
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "**.svg"
|
||||
pull_request:
|
||||
types: [opened, review_requested, synchronize]
|
||||
|
||||
jobs:
|
||||
svg_validator:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check for script in SVG logos
|
||||
run : |
|
||||
sh check_logos.sh
|
||||
19
check_logos.sh
Executable file
19
check_logos.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
found_js=false
|
||||
|
||||
for file in *.svg; do
|
||||
[ -f "$file" ] || continue
|
||||
|
||||
if grep -i -E '<script' "$file" > /dev/null; then
|
||||
echo "Javascript found in: $file"
|
||||
found_js=true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$found_js" = true ]; then
|
||||
exit 1
|
||||
else
|
||||
echo "No script tags found in SVG files"
|
||||
exit 0
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user