Skip to content

Commit

Permalink
fix: currectLabel 추가 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeSeoKim committed Aug 19, 2021
1 parent 4add255 commit a52be3c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
17 changes: 10 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_e.trys.push([0, 14, , 15]);
_e.trys.push([0, 15, , 16]);
token = core.getInput("repo-token", { required: true });
currectLabel_1 = core.getInput("currect-label", { required: true });
wrongLabel_1 = core.getInput("wrong-label", { required: true });
Expand Down Expand Up @@ -155,7 +155,7 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
_e.sent();
core.info("PR " + prNumber + ": wrong submission (too many submissions)");
return [2 /*return*/];
case 7: return [4 /*yield*/, exports.addLabels(client, prNumber, [subjects[0], currectLabel_1])];
case 7: return [4 /*yield*/, exports.addLabels(client, prNumber, [subjects[0]])];
case 8:
_e.sent();
subject = config.subjects[subjects[0]];
Expand Down Expand Up @@ -198,22 +198,25 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
reason = _d[_c];
_loop_2(reason);
}
return [4 /*yield*/, exports.addLabels(client, prNumber, [currectLabel_1])];
case 13:
_e.sent();
return [4 /*yield*/, exports.addComment(client, prNumber, [
!!pr.user && "\uD83D\uDC4B \uC548\uB155\uD558\uC138\uC694! " + pr.user.login + "\uB2D8!",
"- \uD83C\uDF89 \uC815\uC0C1\uC801\uC73C\uB85C \uC81C\uCD9C \uB418\uC168\uC2B5\uB2C8\uB2E4! \uD3C9\uAC00 \uB9E4\uCE6D\uC744 \uAE30\uB2EC\uB824\uC8FC\uC138\uC694!",
"- PR \uC81C\uCD9C \uAE30\uAC04: " + exports.toLocalString(subject.asOfDate) + " ~ " + exports.toLocalString(subject.dueDate),
"- PR \uC81C\uCD9C \uC2DC\uAC01: " + exports.toLocalString(pr.created_at),
"- PR \uB9C8\uC9C0\uB9C9 \uC5C5\uB370\uC774\uD2B8 \uC2DC\uAC01: " + exports.toLocalString(pr.updated_at),
].join("\n"))];
case 13:
_e.sent();
return [3 /*break*/, 15];
case 14:
_e.sent();
return [3 /*break*/, 16];
case 15:
error_1 = _e.sent();
core.error(error_1);
core.setFailed(error_1.message);
return [3 /*break*/, 15];
case 15: return [2 /*return*/];
return [3 /*break*/, 16];
case 16: return [2 /*return*/];
}
});
}); };
Expand Down
17 changes: 10 additions & 7 deletions lib/pr-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_e.trys.push([0, 14, , 15]);
_e.trys.push([0, 15, , 16]);
token = core.getInput("repo-token", { required: true });
currectLabel_1 = core.getInput("currect-label", { required: true });
wrongLabel_1 = core.getInput("wrong-label", { required: true });
Expand Down Expand Up @@ -148,7 +148,7 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
_e.sent();
core.info("PR " + prNumber + ": wrong submission (too many submissions)");
return [2 /*return*/];
case 7: return [4 /*yield*/, exports.addLabels(client, prNumber, [subjects[0], currectLabel_1])];
case 7: return [4 /*yield*/, exports.addLabels(client, prNumber, [subjects[0]])];
case 8:
_e.sent();
subject = config.subjects[subjects[0]];
Expand Down Expand Up @@ -191,22 +191,25 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
reason = _d[_c];
_loop_2(reason);
}
return [4 /*yield*/, exports.addLabels(client, prNumber, [currectLabel_1])];
case 13:
_e.sent();
return [4 /*yield*/, exports.addComment(client, prNumber, [
!!pr.user && "\uD83D\uDC4B \uC548\uB155\uD558\uC138\uC694! " + pr.user.login + "\uB2D8!",
"- \uD83C\uDF89 \uC815\uC0C1\uC801\uC73C\uB85C \uC81C\uCD9C \uB418\uC168\uC2B5\uB2C8\uB2E4! \uD3C9\uAC00 \uB9E4\uCE6D\uC744 \uAE30\uB2EC\uB824\uC8FC\uC138\uC694!",
"- PR \uC81C\uCD9C \uAE30\uAC04: " + exports.toLocalString(subject.asOfDate) + " ~ " + exports.toLocalString(subject.dueDate),
"- PR \uC81C\uCD9C \uC2DC\uAC01: " + exports.toLocalString(pr.created_at),
"- PR \uB9C8\uC9C0\uB9C9 \uC5C5\uB370\uC774\uD2B8 \uC2DC\uAC01: " + exports.toLocalString(pr.updated_at),
].join("\n"))];
case 13:
_e.sent();
return [3 /*break*/, 15];
case 14:
_e.sent();
return [3 /*break*/, 16];
case 15:
error_1 = _e.sent();
core.error(error_1);
core.setFailed(error_1.message);
return [3 /*break*/, 15];
case 15: return [2 /*return*/];
return [3 /*break*/, 16];
case 16: return [2 /*return*/];
}
});
}); };
Expand Down
4 changes: 3 additions & 1 deletion src/pr-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const run = async () => {
return;
}

await addLabels(client, prNumber, [subjects[0], currectLabel]);
await addLabels(client, prNumber, [subjects[0]]);

const subject = config.subjects[subjects[0]];

Expand Down Expand Up @@ -164,6 +164,8 @@ export const run = async () => {
}
}

await addLabels(client, prNumber, [currectLabel]);

await addComment(
client,
prNumber,
Expand Down

0 comments on commit a52be3c

Please sign in to comment.