From b36719126706286a07095e173384db96fab4f84b Mon Sep 17 00:00:00 2001 From: Recoordinate <296084221+latent-9@users.noreply.github.com> Date: Sat, 22 Aug 2026 22:46:33 +1200 Subject: [PATCH] fix(ci): restore the undefined warningMessage in spam-detection workflow (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The github-script step references warningMessage in createComment, but its definition was removed in 9ac0c27 while the usage was kept. When a comment tripped the threshold, the step threw 'ReferenceError: warningMessage is not defined', which the surrounding try/catch swallowed — so the scam-warning comment was never posted (only the label was applied). Restore the message, built from the variables already in scope (author, foundPatterns, suspiciousLinks). --- .github/workflows/spam-detection.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/spam-detection.yml b/.github/workflows/spam-detection.yml index 9b061b4..46157e1 100644 --- a/.github/workflows/spam-detection.yml +++ b/.github/workflows/spam-detection.yml @@ -92,6 +92,11 @@ jobs: // Trigger on either multiple patterns or high spam score if (foundPatterns.length > 2 || spamScore >= 3) { + const warningMessage = + `⚠️ Potential scam detected in comment by ${author}:\n` + + `- Suspicious patterns found: ${foundPatterns.join(', ')}\n` + + `${suspiciousLinks ? '- Contains external links\n' : ''}` + + `\n@${context.repo.owner} Please review this comment.`; try { // Create a warning comment await github.rest.issues.createComment({