diff --git a/src/modules/chatwork.ts b/src/modules/chatwork.ts index 9a6d256..6e29fc2 100644 --- a/src/modules/chatwork.ts +++ b/src/modules/chatwork.ts @@ -9,15 +9,7 @@ export const buildChatworkPostMentionMessage = ( senderName: string ): string => { const mentionBlock = chatworkIdsForMention.map((id) => `[To:${id}]`).join(" "); - const body = githubBody; - - const message = [ - mentionBlock, - `${chatworkIdsForMention.length === 1 ? "has" : "have"}`, - `been mentioned at ${commentLink} ${issueTitle} by ${senderName}`, - ].join(" "); - - return `${message}\n${body}`; + return `${mentionBlock}\n[info][title]${senderName}がメンションしました[/title] ${issueTitle}\n${commentLink}\n[hr]\n${githubBody}\n[/info]`; }; export const buildChatworkPostMessage = ( @@ -26,11 +18,7 @@ export const buildChatworkPostMessage = ( githubBody: string, senderName: string ): string => { - const message = [ - `commented at ${commentLink} ${issueTitle} by ${senderName}`, - ].join(" "); - - return `${message}\n${githubBody}`; + return `[info][title]${senderName}がコメントしました[/title] ${issueTitle}\n${commentLink}\n[hr]\n${githubBody}\n[/info]`; }; export const buildChatworkErrorMessage = ( diff --git a/src/modules/github.ts b/src/modules/github.ts index 2794f0a..48dba39 100644 --- a/src/modules/github.ts +++ b/src/modules/github.ts @@ -149,17 +149,6 @@ export const pickupInfoFromGithubPayload = ( senderName: payload.sender?.login || "", }; } - - if (!acceptActionTypes.pull_request.includes(action)) { - throw buildError(payload); - } - - return { - body: payload.pull_request.body || "", - title: payload.pull_request.title, - url: payload.pull_request.html_url || "", - senderName: payload.sender?.login || "", - }; } throw buildError(payload);