Skip to content

Commit 44c730e

Browse files
committed
npm run build
1 parent 7c54551 commit 44c730e

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

kbanalysis/dist/src/index.js

+22-17
Original file line numberDiff line numberDiff line change
@@ -8541,10 +8541,11 @@ async function handleKBIssue(octokit, owner, repo, issue) {
85418541
});
85428542
if (resp.status == 200) {
85438543
let old_body = resp.data.body;
8544-
let action_name = get_action(issue.title);
8544+
let action_name = getAction(issue.title);
85458545
if (old_body.indexOf(action_name) >= 0) {
85468546
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[!] Action ${action_name} is already being tracked`);
8547-
return "Issue already being tracked";
8547+
let ret = await closeIssue(octokit, owner, repo, issue);
8548+
return ret;
85488549
}
85498550
let new_body = old_body + comment;
85508551
let resp2 = await octokit.rest.issues.updateComment({
@@ -8558,20 +8559,8 @@ async function handleKBIssue(octokit, owner, repo, issue) {
85588559
}
85598560
else {
85608561
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[!] Added ${issue.title} in tracking comment.`);
8561-
let resp3 = await octokit.rest.issues.update({
8562-
owner: owner,
8563-
repo: repo,
8564-
issue_number: issue.number,
8565-
state: "closed",
8566-
});
8567-
if (resp3.status === 200) {
8568-
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[!] Closed Issue ${issue.number}`);
8569-
return "success";
8570-
}
8571-
else {
8572-
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[X] Unable to close issue ${issue.number}`);
8573-
return "error: unable to close issue";
8574-
}
8562+
let ret = await closeIssue(octokit, owner, repo, issue);
8563+
return ret;
85758564
}
85768565
}
85778566
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[X] Unable to handle: ${issue.title} `);
@@ -8612,10 +8601,26 @@ async function prepareComment(client, owner, repo, issue) {
86128601
body: "unable to fetch analysis",
86138602
});
86148603
}
8615-
function get_action(x) {
8604+
function getAction(x) {
86168605
x = x.split(" ");
86178606
return x[6];
86188607
}
8608+
async function closeIssue(octokit, owner, repo, issue) {
8609+
let resp3 = await octokit.rest.issues.update({
8610+
owner: owner,
8611+
repo: repo,
8612+
issue_number: issue.number,
8613+
state: "closed",
8614+
});
8615+
if (resp3.status === 200) {
8616+
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[!] Closed Issue ${issue.number}`);
8617+
return "success";
8618+
}
8619+
else {
8620+
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`[X] Unable to close issue ${issue.number}`);
8621+
return "error: unable to close issue";
8622+
}
8623+
}
86198624

86208625

86218626
/***/ }),

0 commit comments

Comments
 (0)