mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-24 20:58:05 +00:00
fix(ci): restore the undefined warningMessage in spam-detection workflow (#187)
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).
This commit is contained in:
@@ -92,6 +92,11 @@ jobs:
|
|||||||
|
|
||||||
// Trigger on either multiple patterns or high spam score
|
// Trigger on either multiple patterns or high spam score
|
||||||
if (foundPatterns.length > 2 || spamScore >= 3) {
|
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 {
|
try {
|
||||||
// Create a warning comment
|
// Create a warning comment
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
|
|||||||
Reference in New Issue
Block a user