Validate SVG logos

This commit is contained in:
Felipe Knorr Kuhn 2025-04-20 09:39:25 -07:00
parent 6ee38e6628
commit 557420075f
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A
2 changed files with 38 additions and 0 deletions

19
.github/workflows/validate-logos.yml vendored Normal file
View 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
View 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