From a52be3ce9535f522aac85236dcdfc8a66c4854bd Mon Sep 17 00:00:00 2001 From: JaeSeoKim Date: Thu, 19 Aug 2021 21:36:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20currectLabel=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 17 ++++++++++------- lib/pr-checker.js | 17 ++++++++++------- src/pr-checker.ts | 4 +++- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0d90ecf..a13db3f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 }); @@ -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]]; @@ -198,6 +198,9 @@ 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!", @@ -205,15 +208,15 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () { "- 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*/]; } }); }); }; diff --git a/lib/pr-checker.js b/lib/pr-checker.js index af581ac..3418f3e 100644 --- a/lib/pr-checker.js +++ b/lib/pr-checker.js @@ -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 }); @@ -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]]; @@ -191,6 +191,9 @@ 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!", @@ -198,15 +201,15 @@ var run = function () { return __awaiter(void 0, void 0, void 0, function () { "- 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*/]; } }); }); }; diff --git a/src/pr-checker.ts b/src/pr-checker.ts index 33cde3e..9ff0a39 100644 --- a/src/pr-checker.ts +++ b/src/pr-checker.ts @@ -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]]; @@ -164,6 +164,8 @@ export const run = async () => { } } + await addLabels(client, prNumber, [currectLabel]); + await addComment( client, prNumber,