From 93d74a9beafe0f1c37e8293139414c1d14e56418 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 16 Jan 2026 21:44:15 +0000 Subject: [PATCH] Dont include quick links if review has no comments --- entry | 12 ++++++++---- mcp/review.ts | 13 +++++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/entry b/entry index fa73875..baa6fff 100755 --- a/entry +++ b/entry @@ -119176,9 +119176,13 @@ function CreatePullRequestReviewTool(ctx) { throw new Error(`createReview returned invalid data: ${JSON.stringify(result.data)}`); } const reviewId = result.data.id; - const apiUrl = process.env.API_URL || "https://pullfrog.com"; - const fixAllUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix&review_id=${reviewId}`; - const fixApprovedUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix-approved&review_id=${reviewId}`; + const customParts = []; + if (comments.length > 0) { + const apiUrl = process.env.API_URL || "https://pullfrog.com"; + const fixAllUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix&review_id=${reviewId}`; + const fixApprovedUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix-approved&review_id=${reviewId}`; + customParts.push(`[Fix all \u2794](${fixAllUrl})`, `[Fix \u{1F44D}s \u2794](${fixApprovedUrl})`); + } const footer = buildPullfrogFooter({ workflowRun: { owner: ctx.repo.owner, @@ -119186,7 +119190,7 @@ function CreatePullRequestReviewTool(ctx) { runId: ctx.runId, jobId: ctx.jobId }, - customParts: [`[Fix all \u2794](${fixAllUrl})`, `[Fix \u{1F44D}s \u2794](${fixApprovedUrl})`] + customParts }); const updatedBody = (body || "") + footer; await ctx.octokit.rest.pulls.updateReview({ diff --git a/mcp/review.ts b/mcp/review.ts index 23e43e4..aaaf9bb 100644 --- a/mcp/review.ts +++ b/mcp/review.ts @@ -113,9 +113,14 @@ export function CreatePullRequestReviewTool(ctx: ToolContext) { const reviewId = result.data.id; // build quick links footer and update the review body - const apiUrl = process.env.API_URL || "https://pullfrog.com"; - const fixAllUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix&review_id=${reviewId}`; - const fixApprovedUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix-approved&review_id=${reviewId}`; + // only include "Fix all" and "Fix 👍s" links if there are actual review comments + const customParts: string[] = []; + if (comments.length > 0) { + const apiUrl = process.env.API_URL || "https://pullfrog.com"; + const fixAllUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix&review_id=${reviewId}`; + const fixApprovedUrl = `${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${pull_number}?action=fix-approved&review_id=${reviewId}`; + customParts.push(`[Fix all ➔](${fixAllUrl})`, `[Fix 👍s ➔](${fixApprovedUrl})`); + } const footer = buildPullfrogFooter({ workflowRun: { @@ -124,7 +129,7 @@ export function CreatePullRequestReviewTool(ctx: ToolContext) { runId: ctx.runId, jobId: ctx.jobId, }, - customParts: [`[Fix all ➔](${fixAllUrl})`, `[Fix 👍s ➔](${fixApprovedUrl})`], + customParts, }); const updatedBody = (body || "") + footer;