mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-10-14 07:43:46 +08:00
chore: update dist
This commit is contained in:
58
dist/index.js
vendored
58
dist/index.js
vendored
@@ -16060,7 +16060,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.doToggleLabels = exports.doWelcome = exports.doMarkDuplicate = exports.doMarkAssignees = exports.doLockIssues = exports.doFindIssues = exports.doFindComments = exports.doCloseIssues = exports.doCheckIssue = exports.doCheckInactive = exports.doQueryIssues = exports.initAdvancedICE = void 0;
|
exports.doWelcome = exports.doToggleLabels = exports.doMarkDuplicate = exports.doMarkAssignees = exports.doLockIssues = exports.doFindIssues = exports.doFindComments = exports.doCloseIssues = exports.doCheckIssue = exports.doCheckInactive = exports.doQueryIssues = exports.initAdvancedICE = void 0;
|
||||||
const actions_util_1 = __nccwpck_require__(6972);
|
const actions_util_1 = __nccwpck_require__(6972);
|
||||||
const dayjs_1 = __importDefault(__nccwpck_require__(7401));
|
const dayjs_1 = __importDefault(__nccwpck_require__(7401));
|
||||||
const isSameOrBefore_1 = __importDefault(__nccwpck_require__(9517));
|
const isSameOrBefore_1 = __importDefault(__nccwpck_require__(9517));
|
||||||
@@ -16412,6 +16412,30 @@ function doMarkDuplicate(comment, closeReason, labels, emoji) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.doMarkDuplicate = doMarkDuplicate;
|
exports.doMarkDuplicate = doMarkDuplicate;
|
||||||
|
function doToggleLabels(labels = []) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const issue = yield ICE.getIssue();
|
||||||
|
const baseLabels = issue.labels.map(({ name }) => name);
|
||||||
|
const addLabels = [];
|
||||||
|
const removeLabels = [];
|
||||||
|
for (const label of labels) {
|
||||||
|
if (baseLabels.includes(label)) {
|
||||||
|
removeLabels.push(label);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addLabels.push(label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (removeLabels.length) {
|
||||||
|
yield (0, base_1.doRemoveLabels)(removeLabels);
|
||||||
|
}
|
||||||
|
if (addLabels.length) {
|
||||||
|
yield (0, base_1.doAddLabels)(addLabels);
|
||||||
|
}
|
||||||
|
core.info(`[doToggleLabels] Done!`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.doToggleLabels = doToggleLabels;
|
||||||
function doWelcome(auth, issueNumber, body, labels, assignees, emoji) {
|
function doWelcome(auth, issueNumber, body, labels, assignees, emoji) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.info(`[doWelcome] [${auth}]`);
|
core.info(`[doWelcome] [${auth}]`);
|
||||||
@@ -16437,30 +16461,6 @@ function doWelcome(auth, issueNumber, body, labels, assignees, emoji) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.doWelcome = doWelcome;
|
exports.doWelcome = doWelcome;
|
||||||
function doToggleLabels(labels = []) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const issue = yield ICE.getIssue();
|
|
||||||
const baseLabels = issue.labels.map(({ name }) => name);
|
|
||||||
const addLabels = [];
|
|
||||||
const removeLabels = [];
|
|
||||||
for (const label of labels) {
|
|
||||||
if (baseLabels.includes(label)) {
|
|
||||||
removeLabels.push(label);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
addLabels.push(label);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (removeLabels.length) {
|
|
||||||
yield (0, base_1.doRemoveLabels)(removeLabels);
|
|
||||||
}
|
|
||||||
if (addLabels.length) {
|
|
||||||
yield (0, base_1.doAddLabels)(addLabels);
|
|
||||||
}
|
|
||||||
core.info(`[doToggleLabels] Done!`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.doToggleLabels = doToggleLabels;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -16938,6 +16938,10 @@ class IssueHelperEngine {
|
|||||||
yield (0, advanced_1.doMarkDuplicate)(ctx.payload.comment, closeReason, labels, emoji);
|
yield (0, advanced_1.doMarkDuplicate)(ctx.payload.comment, closeReason, labels, emoji);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'toggle-labels': {
|
||||||
|
yield (0, advanced_1.doToggleLabels)(labels);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'welcome': {
|
case 'welcome': {
|
||||||
if (ctx.eventName === 'issues' && ctx.payload.action === 'opened') {
|
if (ctx.eventName === 'issues' && ctx.payload.action === 'opened') {
|
||||||
yield (0, advanced_1.doWelcome)(ctx.actor, issueNumber, body, labels, assignees, emoji);
|
yield (0, advanced_1.doWelcome)(ctx.actor, issueNumber, body, labels, assignees, emoji);
|
||||||
@@ -16947,10 +16951,6 @@ class IssueHelperEngine {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'toggle-labels': {
|
|
||||||
yield (0, advanced_1.doToggleLabels)(labels);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// -[ Advanced End ]->
|
// -[ Advanced End ]->
|
||||||
default: {
|
default: {
|
||||||
core.warning(`The ${action} is not allowed.`);
|
core.warning(`The ${action} is not allowed.`);
|
||||||
|
Reference in New Issue
Block a user