Skip to content

Commit

Permalink
Ensure iroj urls are not used in Mod.Link
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Dec 6, 2024
1 parent 0ec1417 commit 303b795
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ for file in mods/**/*.xml; do

# Check Mod.Link
mod_link=$(xmllint --xpath 'string(//Mod/Link)' "$file")
if [ -n "$mod_link" ]; then
if [[ $mod_link =~ ^iroj://([a-zA-Z]+)/ ]]; then
errors+=" - Verify Mod.Link failed: Invalid URL used\n"
ret=1
elif [ -n "$mod_link" ]; then
curl --output /dev/null --silent --head --fail "$mod_link" -A "Mozilla/5.0"
if [ $? -ne 0 ]; then
warnings+=" - Verify Mod.Link failed: [link]($mod_link)\n"
Expand Down

0 comments on commit 303b795

Please sign in to comment.