Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
通知を見やすく、pr作成は通知しない
Browse files Browse the repository at this point in the history
  • Loading branch information
shikajiro committed Sep 22, 2023
1 parent fb614e3 commit 1a3ae91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
16 changes: 2 additions & 14 deletions src/modules/chatwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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 = (
Expand Down
11 changes: 0 additions & 11 deletions src/modules/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1a3ae91

Please sign in to comment.