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

Commit

Permalink
labelの機能を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
shikajiro committed Feb 27, 2024
1 parent 900cd3b commit 5554e3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
40 changes: 8 additions & 32 deletions src/repository/chatwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,17 @@ export const ChatworkRepositoryImpl = {
roomId: string,
accountId: string,
message: string,
labels: string[],
): Promise<ChatworkPostResult> => {
const isHurry = labels.find((label) => label === "hurry");
const is2days = labels.find((label) => label === "2days");
let limit = 0;
const now = new Date();
if (isHurry !== undefined) {
limit = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
23,
59,
59,
).getTime();
} else if (is2days !== undefined) {
limit = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 2,
23,
59,
59,
).getTime();
} else {
// is2weeks or default
limit = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 14,
23,
59,
59,
).getTime();
}
limit = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 14,
23,
59,
59,
).getTime();
const encodedParams = new URLSearchParams();
encodedParams.set("body", message);
encodedParams.set("to_ids", accountId);
Expand Down
6 changes: 0 additions & 6 deletions src/usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ export const execPrReviewRequestedMention = async (
}
core.info(`reviewers ${reviewers}`);

core.info(`labels ${payload.pull_request?.labels[0]?.name}`);
const labels = payload.pull_request?.labels?.map(
(label: any) => label.name,
) as string[];

const slackIds = convertToChatworkUsername(reviewers, mapping);
if (slackIds.length === 0) {
core.info(
Expand Down Expand Up @@ -87,7 +82,6 @@ export const execPrReviewRequestedMention = async (
account.room_id,
account.account_id,
message,
labels,
);
}
};
Expand Down

0 comments on commit 5554e3d

Please sign in to comment.