Skip to content

Commit 355bc95

Browse files
committed
Update comment with quick feedback
Closes #30
1 parent 931ff24 commit 355bc95

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

dist/index.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/handlers.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const issueCommentHandler = async (octokit: Octokit, chatOpService: ChatO
1111
const issueCommentPayload = context.payload as IssueCommentEvent;
1212
if (issueCommentPayload.action === 'created') {
1313
const comment = issueCommentPayload.comment.body;
14+
let updatedComment = comment;
1415
core.debug(`Comment: ${comment}`);
1516
const chatOpCommand = getChatOpCommand(chatOpService, comment);
1617

@@ -19,6 +20,14 @@ export const issueCommentHandler = async (octokit: Octokit, chatOpService: ChatO
1920
process.exit(core.ExitCode.Success);
2021
}
2122

23+
updatedComment += '\n1. Creating the branch in ADO...';
24+
25+
await octokit.rest.issues.updateComment({
26+
...context.issue,
27+
comment_id: issueCommentPayload.comment.id,
28+
body: updatedComment
29+
});
30+
2231
const params = getParameters(chatOpService, chatOpCommand, comment);
2332

2433
resultMessage = await azureDevOpsService.createBranch({
@@ -29,10 +38,12 @@ export const issueCommentHandler = async (octokit: Octokit, chatOpService: ChatO
2938
branchType: params['-type']
3039
});
3140

32-
await octokit.rest.issues.createComment({
41+
updatedComment += `\n1. ${resultMessage}`;
42+
43+
await octokit.rest.issues.updateComment({
3344
...context.issue,
34-
issue_number: context.issue.number,
35-
body: resultMessage || 'There was nothing to do!'
45+
comment_id: issueCommentPayload.comment.id,
46+
body: updatedComment
3647
});
3748
}
3849
return resultMessage;

0 commit comments

Comments
 (0)