review-labels #14

Merged
ztimson merged 5 commits from review-labels into master 2026-01-14 14:06:21 -05:00
Showing only changes of commit 3b01e1bfc1 - Show all commits

View File

@@ -28,7 +28,7 @@ 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}`)
ztimson marked this conversation as resolved
Review

Missing error handling: The fetch call should handle errors. If the API call fails, info will be undefined and line 30 will throw an error when trying to access info.labels.

Missing error handling: The fetch call should handle errors. If the API call fails, `info` will be undefined and line 30 will throw an error when trying to access `info.labels`.
Review

Missing error handling: The fetch call should handle network errors with a .catch() handler. If the API call fails due to network issues, the promise will reject and crash the script before reaching line 30.

Missing error handling: The fetch call should handle network errors with a .catch() handler. If the API call fails due to network issues, the promise will reject and crash the script before reaching line 30.
.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)) {
if(info.labels?.length > 0 && !info.labels.some(l => l.name === labelEnabled)) {
console.log('Skipping');
return process.exit();
}