generated from ztimson/template
Fixed more logic checks
This commit is contained in:
@@ -27,8 +27,11 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false});
|
||||
|
||||
console.log(`Reviewing: ${root}\n`);
|
||||
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()}`); });
|
||||
if(info.labels?.length > 0 && !info.labels.some(l => l.name === labelEnabled)) {
|
||||
.then(async resp => {
|
||||
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');
|
||||
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:
|
||||
\`\`\`md
|
||||
${info.body}
|
||||
${info.body || 'None'}
|
||||
\`\`\`
|
||||
|
||||
Git Diff:
|
||||
|
||||
Reference in New Issue
Block a user