Fixed more logic checks
Some checks failed
Publish Library / Build NPM Project (push) Successful in 4s
Code review / review (pull_request) Has been cancelled
Publish Library / Tag Version (push) Successful in 6s

This commit is contained in:
2026-01-14 14:05:41 -05:00
parent 3b01e1bfc1
commit 7447204351

View File

@@ -27,8 +27,11 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false});
console.log(`Reviewing: ${root}\n`); console.log(`Reviewing: ${root}\n`);
const info = await fetch(`${git}/api/v1/repos/${owner}/${repo}/pulls/${pr}`) const info = await fetch(`${git}/api/v1/repos/${owner}/${repo}/pulls/${pr}`)
.then(async resp => { return resp.ok ? resp.json() : throw new Error(`${resp.status} ${await resp.text()}`); }); .then(async resp => {
if(info.labels?.length > 0 && !info.labels.some(l => l.name === labelEnabled)) { if(resp.ok) return resp.json();
throw new Error(`${resp.status} ${await resp.text()}`);
});
if(!info.labels.some(l => l.name === labelEnabled)) {
console.log('Skipping'); console.log('Skipping');
return process.exit(); return process.exit();
} }
@@ -95,10 +98,10 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false});
}] }]
}); });
const messages = await ai.language.ask(`Title: ${info.title} const messages = await ai.language.ask(`Title: ${info.title || 'None'}
Description: Description:
\`\`\`md \`\`\`md
${info.body} ${info.body || 'None'}
\`\`\` \`\`\`
Git Diff: Git Diff: