fix: yaml syntax in ai moderator workflow (template literal indentation)

This commit is contained in:
2026-07-30 19:03:43 +02:00
parent dc44cfcba2
commit 22777339b8
+24 -23
View File
@@ -35,22 +35,20 @@ jobs:
const coc = fs.readFileSync('.github/CODE_OF_CONDUCT.md', 'utf8');
const prompt = `You are a community moderator for the Antergos NeXT project.
Code of Conduct:
${coc}
Analyze the following content for violations of this Code of Conduct.
Respond with ONLY valid JSON — no markdown, no backticks, no explanation.
{
"violation": true/false,
"reason": "short reason if violation else empty",
"severity": 1-10
}
Content:
${content}`;
const prompt = [
'You are a community moderator for the Antergos NeXT project.',
'',
'Code of Conduct:',
coc,
'',
'Analyze the following content for violations of this Code of Conduct.',
'Respond with ONLY valid JSON - no markdown, no backticks, no explanation.',
'',
'{"violation": true/false, "reason": "short reason or empty", "severity": 1-10}',
'',
'Content:',
content
].join('\n');
const model = 'llama-3.1-8b-instant';
@@ -94,13 +92,16 @@ jobs:
return;
}
const warning = `**AI Moderator Notice**
Your comment appears to violate the project's [Code of Conduct](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/blob/master/.github/CODE_OF_CONDUCT.md).
Reason: ${decision.reason}
Please keep discussions respectful and constructive. Repeated violations may result in moderation actions.`;
const warning = [
'**AI Moderator Notice**',
'',
'Your comment appears to violate the project\'s ' +
'[Code of Conduct](' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/blob/master/.github/CODE_OF_CONDUCT.md).',
'',
'Reason: ' + decision.reason,
'',
'Please keep discussions respectful and constructive. Repeated violations may result in moderation actions.'
].join('\n');
try {
await github.rest.issues.createComment({