diff --git a/src/refine.mjs b/src/refine.mjs index 6046713..d61cc01 100644 --- a/src/refine.mjs +++ b/src/refine.mjs @@ -32,7 +32,7 @@ dotenv.config({path: '.env.local', override: true, quiet: true}); if(resp.ok) return resp.json(); else throw new Error(`${resp.status} ${await resp.text()}`); }); - if(issueData.labels?.[0]?.name !== 1 || issueData.labels?.[0] !== 'Review/AI') { + if(issueData.labels?.[0] !== 1 || issueData.labels?.[0]?.name !== 'Review/AI') { console.log('Skipping'); return process.exit(); } @@ -169,7 +169,7 @@ Output ONLY markdown. No explanations, labels, or extra formatting.`}); system: `Your job is to identify duplicates. Respond with the ID number of the duplicate or nothing if there are no matches \n\n${dupes}` }))?.pop()?.content; // Handle duplicates - if(!!hasDuplicates && (dupeId = dupeIds.find(id => new RegExp(`(^| )${id}( |$)`, 'm').test(hasDuplicates)))) { + if(!!hasDuplicates && (dupeId = dupeIds.find(id => new RegExp(`\\b${id}\\b`, 'm').test(hasDuplicates)))) { await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/comments`, { method: 'POST', headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'},