fix: yaml syntax in ai moderator workflow (template literal indentation)
This commit is contained in:
@@ -35,22 +35,20 @@ jobs:
|
|||||||
|
|
||||||
const coc = fs.readFileSync('.github/CODE_OF_CONDUCT.md', 'utf8');
|
const coc = fs.readFileSync('.github/CODE_OF_CONDUCT.md', 'utf8');
|
||||||
|
|
||||||
const prompt = `You are a community moderator for the Antergos NeXT project.
|
const prompt = [
|
||||||
|
'You are a community moderator for the Antergos NeXT project.',
|
||||||
Code of Conduct:
|
'',
|
||||||
${coc}
|
'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.
|
'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,
|
'{"violation": true/false, "reason": "short reason or empty", "severity": 1-10}',
|
||||||
"reason": "short reason if violation else empty",
|
'',
|
||||||
"severity": 1-10
|
'Content:',
|
||||||
}
|
content
|
||||||
|
].join('\n');
|
||||||
Content:
|
|
||||||
${content}`;
|
|
||||||
|
|
||||||
const model = 'llama-3.1-8b-instant';
|
const model = 'llama-3.1-8b-instant';
|
||||||
|
|
||||||
@@ -94,13 +92,16 @@ jobs:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const warning = `**AI Moderator Notice**
|
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).
|
'',
|
||||||
|
'Your comment appears to violate the project\'s ' +
|
||||||
Reason: ${decision.reason}
|
'[Code of Conduct](' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/blob/master/.github/CODE_OF_CONDUCT.md).',
|
||||||
|
'',
|
||||||
Please keep discussions respectful and constructive. Repeated violations may result in moderation actions.`;
|
'Reason: ' + decision.reason,
|
||||||
|
'',
|
||||||
|
'Please keep discussions respectful and constructive. Repeated violations may result in moderation actions.'
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
|
|||||||
Reference in New Issue
Block a user