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,