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

labelの機能を削除 #15

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: "ja"
early_access: false
reviews:
request_changes_workflow: false
high_level_summary: true
poem: true
review_status: true
collapse_walkthrough: false
path_filters:
- "!**/.xml"
path_instructions:
- path: "**/*.js"
instructions: "Review the JavaScript code for conformity with the Google JavaScript style guide, highlighting any deviations."
- path: "tests/**/*"
instructions: |
"Assess the unit test code employing the Mocha testing framework. Confirm that:
- The tests adhere to Mocha's established best practices.
- Test descriptions are sufficiently detailed to clarify the purpose of each test."
auto_review:
enabled: true
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
drafts: false
base_branches:
- "develop"
- "feat/.*"
chat:
auto_reply: true
41 changes: 8 additions & 33 deletions src/repository/chatwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,16 @@ 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();
}
const limit = Date.UTC(
now.getUTCFullYear(),
now.getUTCMonth(),
now.getUTCDate() + 14,
23,
59,
59
);
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
Loading