diff --git a/.gitea/scripts/validate-pr.js b/.gitea/scripts/validate-pr.js index de99ec4..9096d4d 100644 --- a/.gitea/scripts/validate-pr.js +++ b/.gitea/scripts/validate-pr.js @@ -104,24 +104,7 @@ const changedFiles = process.argv[3]?.split('\n').filter(f => f.trim()) || []; if (!prAuthor) { console.error('āŒ Error: PR author not provided'); process.exit(1); -}// Check thumbnail if provided (optional) - if (plugin.thumbnail) { - try { - new URL(plugin.thumbnail); - - // Validate thumbnail meets requirements - try { - const thumbInfo = await validateThumbnail(plugin.thumbnail); - console.log(` āœ“ Thumbnail: ${thumbInfo.format} ${thumbInfo.width}x${thumbInfo.height} (${(thumbInfo.size / 1024).toFixed(1)}KB)`); - } catch (thumbErr) { - errors.push(`āŒ ${file}: Thumbnail validation failed: ${thumbErr.message}`); - } - } catch { - errors.push(`āŒ ${file}: Invalid thumbnail URL: ${plugin.thumbnail}`); - } - } - - +} console.log(`\nšŸ” Validating PR from: ${prAuthor}`); console.log(`šŸ“ Changed files: ${changedFiles.length}`); @@ -235,6 +218,23 @@ for (const file of changedFiles) { } } + // Check thumbnail if provided (optional) + if (plugin.thumbnail) { + try { + new URL(plugin.thumbnail); + + // Validate thumbnail meets requirements + try { + const thumbInfo = await validateThumbnail(plugin.thumbnail); + console.log(` āœ“ Thumbnail: ${thumbInfo.format} ${thumbInfo.width}x${thumbInfo.height} (${(thumbInfo.size / 1024).toFixed(1)}KB)`); + } catch (thumbErr) { + errors.push(`āŒ ${file}: Thumbnail validation failed: ${thumbErr.message}`); + } + } catch { + errors.push(`āŒ ${file}: Invalid thumbnail URL: ${plugin.thumbnail}`); + } + } + if (errors.length === 0) { added.push(pluginId); console.log(`āœ… Valid plugin: ${plugin.name}`);