Merge pull request #33 from mempool/knorrium/validate_logos

Validate SVG logos
This commit is contained in:
wiz 2025-09-04 18:17:02 +09:00 committed by GitHub
commit 4153860aa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 0 deletions

20
.github/workflows/validate-logos.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: SVG Check
on:
push:
paths:
- "**.svg"
pull_request:
types: [opened, review_requested, synchronize]
jobs:
svg_validator:
name: Validate SVG logos
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