diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fcd60c6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Rutvik Kulkarni
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/dist/index.js b/dist/index.js
index 856a8a4..132a93c 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -37461,7 +37461,7 @@ async function run() {
core.setOutput('summary', analysis.summary);
core.setOutput('root-cause', analysis.rootCause);
core.info(`Analysis complete: ${analysis.summary}`);
- await (0, reporter_1.postReport)(githubToken, context, analysis, failedJobs.map(j => j.name));
+ await (0, reporter_1.postReport)(githubToken, context, analysis, failedJobs.map(j => j.name), provider);
core.info('Report posted');
}
run().catch(core.setFailed);
@@ -37512,13 +37512,21 @@ exports.postReport = postReport;
const core = __importStar(__nccwpck_require__(7484));
const github = __importStar(__nccwpck_require__(3228));
const COMMENT_MARKER = '';
-async function postReport(token, context, analysis, failedJobNames) {
+const PROVIDER_LABEL = {
+ anthropic: 'Claude (Anthropic)',
+ gemini: 'Gemini (Google)',
+ openai: 'GPT-4o mini (OpenAI)',
+ groq: 'Llama 3.3 (Groq)',
+};
+async function postReport(token, context, analysis, failedJobNames, provider) {
await Promise.all([
- writeJobSummary(context, analysis, failedJobNames),
- context.prNumber ? postPrComment(token, context, analysis, failedJobNames) : Promise.resolve(),
+ writeJobSummary(context, analysis, failedJobNames, provider),
+ context.prNumber
+ ? postPrComment(token, context, analysis, failedJobNames, provider)
+ : Promise.resolve(),
]);
}
-async function writeJobSummary(context, analysis, failedJobNames) {
+async function writeJobSummary(context, analysis, failedJobNames, provider) {
await core.summary
.addHeading('CI Failure Analysis', 2)
.addRaw(`> ${analysis.summary}\n\n`)
@@ -37531,12 +37539,12 @@ async function writeJobSummary(context, analysis, failedJobNames) {
.addList(analysis.failedSteps.length > 0 ? analysis.failedSteps.map(s => `\`${s}\``) : ['See logs for details'])
.addHeading('Suggested Fix', 3)
.addRaw(`${analysis.fixSuggestion}\n\n`)
- .addRaw(`[View full logs](${context.runUrl})`)
+ .addRaw(`Analyzed by ${PROVIDER_LABEL[provider]} • [View full logs](${context.runUrl})`)
.write();
}
-async function postPrComment(token, context, analysis, failedJobNames) {
+async function postPrComment(token, context, analysis, failedJobNames, provider) {
const octokit = github.getOctokit(token);
- const body = formatComment(context, analysis, failedJobNames);
+ const body = formatComment(context, analysis, failedJobNames, provider);
const { data: comments } = await octokit.rest.issues.listComments({
owner: context.owner,
repo: context.repo,
@@ -37560,7 +37568,7 @@ async function postPrComment(token, context, analysis, failedJobNames) {
});
}
}
-function formatComment(context, analysis, failedJobNames) {
+function formatComment(context, analysis, failedJobNames, provider) {
const steps = analysis.failedSteps.length > 0
? analysis.failedSteps.map(s => `- \`${s}\``).join('\n')
: '- See logs for details';
@@ -37582,7 +37590,7 @@ ${steps}
### Suggested Fix
${analysis.fixSuggestion}
-Analyzed by [GitHub Logs Analyzer](${context.runUrl}) • commit \`${context.sha.slice(0, 7)}\``;
+Analyzed by ${PROVIDER_LABEL[provider]} • commit \`${context.sha.slice(0, 7)}\` • [View full logs](${context.runUrl})`;
}
diff --git a/src/index.ts b/src/index.ts
index 14f5f4a..3c91acd 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -38,7 +38,7 @@ async function run(): Promise {
core.setOutput('root-cause', analysis.rootCause)
core.info(`Analysis complete: ${analysis.summary}`)
- await postReport(githubToken, context, analysis, failedJobs.map(j => j.name))
+ await postReport(githubToken, context, analysis, failedJobs.map(j => j.name), provider)
core.info('Report posted')
}
diff --git a/src/reporter.ts b/src/reporter.ts
index 4bdb720..c1d9b96 100644
--- a/src/reporter.ts
+++ b/src/reporter.ts
@@ -2,25 +2,37 @@ import * as core from '@actions/core'
import * as github from '@actions/github'
import type { Analysis } from './analyzer'
import type { WorkflowContext } from './github'
+import type { Provider } from './analyzer'
const COMMENT_MARKER = ''
+const PROVIDER_LABEL: Record = {
+ anthropic: 'Claude (Anthropic)',
+ gemini: 'Gemini (Google)',
+ openai: 'GPT-4o mini (OpenAI)',
+ groq: 'Llama 3.3 (Groq)',
+}
+
export async function postReport(
token: string,
context: WorkflowContext,
analysis: Analysis,
- failedJobNames: string[]
+ failedJobNames: string[],
+ provider: Provider
): Promise {
await Promise.all([
- writeJobSummary(context, analysis, failedJobNames),
- context.prNumber ? postPrComment(token, context, analysis, failedJobNames) : Promise.resolve(),
+ writeJobSummary(context, analysis, failedJobNames, provider),
+ context.prNumber
+ ? postPrComment(token, context, analysis, failedJobNames, provider)
+ : Promise.resolve(),
])
}
async function writeJobSummary(
context: WorkflowContext,
analysis: Analysis,
- failedJobNames: string[]
+ failedJobNames: string[],
+ provider: Provider
): Promise {
await core.summary
.addHeading('CI Failure Analysis', 2)
@@ -34,7 +46,7 @@ async function writeJobSummary(
.addList(analysis.failedSteps.length > 0 ? analysis.failedSteps.map(s => `\`${s}\``) : ['See logs for details'])
.addHeading('Suggested Fix', 3)
.addRaw(`${analysis.fixSuggestion}\n\n`)
- .addRaw(`[View full logs](${context.runUrl})`)
+ .addRaw(`Analyzed by ${PROVIDER_LABEL[provider]} • [View full logs](${context.runUrl})`)
.write()
}
@@ -42,10 +54,11 @@ async function postPrComment(
token: string,
context: WorkflowContext,
analysis: Analysis,
- failedJobNames: string[]
+ failedJobNames: string[],
+ provider: Provider
): Promise {
const octokit = github.getOctokit(token)
- const body = formatComment(context, analysis, failedJobNames)
+ const body = formatComment(context, analysis, failedJobNames, provider)
const { data: comments } = await octokit.rest.issues.listComments({
owner: context.owner,
@@ -75,7 +88,8 @@ async function postPrComment(
function formatComment(
context: WorkflowContext,
analysis: Analysis,
- failedJobNames: string[]
+ failedJobNames: string[],
+ provider: Provider
): string {
const steps =
analysis.failedSteps.length > 0
@@ -100,5 +114,5 @@ ${steps}
### Suggested Fix
${analysis.fixSuggestion}
-Analyzed by [GitHub Logs Analyzer](${context.runUrl}) • commit \`${context.sha.slice(0, 7)}\``
+Analyzed by ${PROVIDER_LABEL[provider]} • commit \`${context.sha.slice(0, 7)}\` • [View full logs](${context.runUrl})`
}