Skip to content

Commit 728695c

Browse files
committed
feat(display IssueCommentEvent): with markdown parsed
1 parent be6143b commit 728695c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

app.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const express = require('express');
22
const path = require('path');
33
const axios = require('axios');
4+
const markdownit = require('markdown-it');
5+
const md = new markdownit();
46
// const fs = require('fs');
57
const app = express();
68

@@ -44,6 +46,14 @@ function getOneLineSummaryAndDescription(event) { // TODO: make logic to merge s
4446
const action = event.payload.action;
4547
return actorHref + ' ' + action + ' member ' + whomHref + ' to ' + repoHref;
4648

49+
case 'IssueCommentEvent':
50+
const issueHref = `<a href="${event.payload.issue.html_url}" target="_blank">${event.payload.issue.title} #${event.payload.issue.number}</a>`;
51+
const body = md.render(event.payload.comment.body);
52+
return {
53+
summaryLine: actorHref + ' commented on ' + issueHref,
54+
description: body,
55+
};
56+
4757
// INFO: below events are identified by AI assistant, but i didn't find them in my feed api
4858
// case 'PullRequestEvent':
4959
// return 'opened a pull request';

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"dependencies": {
3+
"axios": "^1.7.7",
34
"express": "^4.21.1",
4-
"axios": "^1.7.7"
5+
"markdown-it": "^14.1.0"
56
}
67
}

0 commit comments

Comments
 (0)