diff --git a/.github/workflows/ticket-refinement.yml b/.github/workflows/ticket-refinement.yml index 7f7088d..87a9fc9 100644 --- a/.github/workflows/ticket-refinement.yml +++ b/.github/workflows/ticket-refinement.yml @@ -14,7 +14,7 @@ jobs: git checkout ${{ github.event.repository.default_branch }} - name: Run AI Formatter - run: npx -y @ztimson/ai-agents@latest format .github/issue_template/ai-refinement.md + run: npx -y @ztimson/ai-agents@latest refine .github/issue_template/ai-refinement.md env: AI_HOST: anthropic AI_MODEL: claude-sonnet-4-5 diff --git a/src/refine.mjs b/src/refine.mjs index 96fafbd..bedcfa2 100644 --- a/src/refine.mjs +++ b/src/refine.mjs @@ -12,7 +12,7 @@ dotenv.config({path: '.env.local', override: true, quiet: true}); (async () => { let p = process.argv[process.argv.length - 1]; if(p === 'refine' || p.endsWith('refine.mjs')) p = null; - if(!/(\/|[A-Z]:)/.test(p)) p = path.join(process.cwd(), p); + if(!/^(\/|[A-Z]:)/m.test(p)) p = path.join(process.cwd(), p); if(!p || !fs.existsSync(p)) throw new Error('Please provide a template'); @@ -83,7 +83,7 @@ ${template.trim()} Output ONLY the formatted ticket, no explanation.` }) - const messages = await ai.language.ask(`Title: ${issueData.title}\n\nDescription:\n${issueData.body || 'No description provided'}`).catch(() => []);; + const messages = await ai.language.ask(`Title: ${issueData.title}\n\nDescription:\n${issueData.body || 'No description provided'}`).catch(() => []); const content = messages?.pop()?.content; if(!content) { console.log('Invalid response from AI');