generated from ztimson/template
Small issue refiner fixes
This commit is contained in:
2
.github/workflows/ticket-refinement.yml
vendored
2
.github/workflows/ticket-refinement.yml
vendored
@@ -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
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user