From 88026179b6727ca505635c8e7fb950c48670e67f Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Fri, 17 Apr 2026 03:47:05 +1000 Subject: [PATCH] Validate all URLs don't end with .git --- .gitea/scripts/validate-pr.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.gitea/scripts/validate-pr.js b/.gitea/scripts/validate-pr.js index 8c0bcf9..021940f 100644 --- a/.gitea/scripts/validate-pr.js +++ b/.gitea/scripts/validate-pr.js @@ -223,11 +223,41 @@ for (const file of changedFiles) { } } + // Check homepage URL if provided (optional) + if (plugin.homepage) { + try { + new URL(plugin.homepage); + + if (plugin.homepage.endsWith('.git')) { + errors.push(`❌ ${file}: Homepage URL should not end with .git: ${plugin.homepage}`); + } + } catch { + errors.push(`❌ ${file}: Invalid homepage URL: ${plugin.homepage}`); + } + } + + // Check downloadUrl if provided (optional) + if (plugin.downloadUrl) { + try { + new URL(plugin.downloadUrl); + + if (plugin.downloadUrl.endsWith('.git')) { + errors.push(`❌ ${file}: Download URL should not end with .git: ${plugin.downloadUrl}`); + } + } catch { + errors.push(`❌ ${file}: Invalid download URL: ${plugin.downloadUrl}`); + } + } + // Check thumbnail if provided (optional) if (plugin.thumbnail) { try { new URL(plugin.thumbnail); + if (plugin.thumbnail.endsWith('.git')) { + errors.push(`❌ ${file}: Thumbnail URL should not end with .git: ${plugin.thumbnail}`); + } + // Validate thumbnail meets requirements try { const thumbInfo = await validateThumbnail(plugin.thumbnail);