Skip to content

Commit cba3c5c

Browse files
committed
feat: quote original comment in success/failure replies
- Format original comment as quoted text in reply - Makes it clear which request was fulfilled or failed - Improves conversation flow in PR comments
1 parent 9bdad7b commit cba3c5c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

assistant/src/index.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,19 @@ async function main(): Promise<void> {
450450
await commitAndPush(commentId, context.headBranch, githubToken, owner, repo);
451451

452452
// Step 7: Add success comment to PR
453+
const quotedComment = context.commentBody
454+
.split('\n')
455+
.map(line => `> ${line}`)
456+
.join('\n');
457+
453458
await addPRComment(
454459
octokit,
455460
owner,
456461
repo,
457462
prNumber,
458-
`✅ Successfully implemented changes requested in [comment](https://github.com/${owner}/${repo}/issues/${prNumber}#issuecomment-${commentId})!
463+
`${quotedComment}
464+
465+
✅ Successfully implemented the requested changes!
459466
460467
The changes have been committed to the \`${context.headBranch}\` branch.`
461468
);
@@ -464,14 +471,21 @@ The changes have been committed to the \`${context.headBranch}\` branch.`
464471
core.info('✨ PR Assistant completed successfully');
465472
} catch (error) {
466473
// Add failure comment to PR
474+
const quotedComment = context.commentBody
475+
.split('\n')
476+
.map(line => `> ${line}`)
477+
.join('\n');
478+
467479
await addPRComment(
468480
octokit,
469481
owner,
470482
repo,
471483
prNumber,
472-
`❌ Failed to implement changes requested in [comment](https://github.com/${owner}/${repo}/issues/${prNumber}#issuecomment-${commentId}).
484+
`${quotedComment}
485+
486+
❌ Failed to implement the requested changes.
473487
474-
Error: ${error instanceof Error ? error.message : String(error)}
488+
**Error:** ${error instanceof Error ? error.message : String(error)}
475489
476490
Please check the [workflow logs](https://github.com/${owner}/${repo}/actions) for more details.`
477491
);

0 commit comments

Comments
 (0)