mirror of
https://github.com/kirodotdev/Kiro.git
synced 2026-11-24 16:38:04 +08:00
- Add GitHub Actions workflows for issue triage, duplicate detection, and stale issue management - Add AWS Bedrock integration for AI-powered issue classification and duplicate detection - Add TypeScript scripts for issue automation including labeling, triaging, and closing workflows - Add comprehensive documentation for setup, implementation, and testing procedures - Add security fixes for prompt injection vulnerabilities in AI model interactions - Add local testing framework with Jest configuration and test utilities - Add rate limiting and retry utilities for GitHub API and AWS Bedrock calls - Add environment configuration examples and ESLint setup for TypeScript scripts - Add detailed testing results and completion status documentation - Implement automated duplicate detection using semantic similarity analysis - Implement stale issue closing with configurable timelines and grace periods - Implement issue classification and auto-labeling based on content analysis
83 lines
2.0 KiB
TypeScript
83 lines
2.0 KiB
TypeScript
/**
|
|
* Workflow Summary Utilities
|
|
* Generate summaries for GitHub Actions workflow runs
|
|
*/
|
|
|
|
import * as fs from "fs";
|
|
|
|
export interface WorkflowSummary {
|
|
success: boolean;
|
|
totalProcessed: number;
|
|
successCount: number;
|
|
failureCount: number;
|
|
skippedCount: number;
|
|
errors: Array<{
|
|
issueNumber?: number;
|
|
step: string;
|
|
error: string;
|
|
}>;
|
|
}
|
|
|
|
/**
|
|
* Create workflow summary
|
|
*/
|
|
export function createSummary(summary: WorkflowSummary): void {
|
|
const summaryFile = process.env.GITHUB_STEP_SUMMARY;
|
|
|
|
if (!summaryFile) {
|
|
console.log("GITHUB_STEP_SUMMARY not available, skipping summary generation");
|
|
return;
|
|
}
|
|
|
|
let content = `## Workflow Summary\n\n`;
|
|
content += `**Status:** ${summary.success ? "✅ Success" : "❌ Failed"}\n\n`;
|
|
content += `### Statistics\n\n`;
|
|
content += `- Total Processed: ${summary.totalProcessed}\n`;
|
|
content += `- Successful: ${summary.successCount}\n`;
|
|
content += `- Failed: ${summary.failureCount}\n`;
|
|
content += `- Skipped: ${summary.skippedCount}\n\n`;
|
|
|
|
if (summary.errors.length > 0) {
|
|
content += `### Errors\n\n`;
|
|
content += `| Issue | Step | Error |\n`;
|
|
content += `|-------|------|-------|\n`;
|
|
|
|
for (const error of summary.errors) {
|
|
const issue = error.issueNumber ? `#${error.issueNumber}` : "N/A";
|
|
const step = error.step;
|
|
const errorMsg = error.error.substring(0, 100);
|
|
content += `| ${issue} | ${step} | ${errorMsg} |\n`;
|
|
}
|
|
content += `\n`;
|
|
}
|
|
|
|
try {
|
|
fs.appendFileSync(summaryFile, content);
|
|
console.log("✓ Workflow summary generated");
|
|
} catch (error) {
|
|
console.error("Error writing workflow summary:", error);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Log error to summary
|
|
*/
|
|
export function logError(
|
|
errors: WorkflowSummary["errors"],
|
|
step: string,
|
|
error: any,
|
|
issueNumber?: number
|
|
): void {
|
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
|
|
errors.push({
|
|
issueNumber,
|
|
step,
|
|
error: errorMessage,
|
|
});
|
|
|
|
console.error(
|
|
`Error in ${step}${issueNumber ? ` for issue #${issueNumber}` : ""}: ${errorMessage}`
|
|
);
|
|
}
|