Skip to content

Commit

Permalink
chore: update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Feb 6, 2023
1 parent dbeaa21 commit 65840f5
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16060,7 +16060,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
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 dayjs_1 = __importDefault(__nccwpck_require__(7401));
const isSameOrBefore_1 = __importDefault(__nccwpck_require__(9517));
Expand Down Expand Up @@ -16412,6 +16412,30 @@ function doMarkDuplicate(comment, closeReason, labels, emoji) {
});
}
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) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`[doWelcome] [${auth}]`);
Expand All @@ -16437,30 +16461,6 @@ function doWelcome(auth, issueNumber, body, labels, assignees, emoji) {
});
}
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;


/***/ }),
Expand Down Expand Up @@ -16938,6 +16938,10 @@ class IssueHelperEngine {
yield (0, advanced_1.doMarkDuplicate)(ctx.payload.comment, closeReason, labels, emoji);
break;
}
case 'toggle-labels': {
yield (0, advanced_1.doToggleLabels)(labels);
break;
}
case 'welcome': {
if (ctx.eventName === 'issues' && ctx.payload.action === 'opened') {
yield (0, advanced_1.doWelcome)(ctx.actor, issueNumber, body, labels, assignees, emoji);
Expand All @@ -16947,10 +16951,6 @@ class IssueHelperEngine {
}
break;
}
case 'toggle-labels': {
yield (0, advanced_1.doToggleLabels)(labels);
break;
}
// -[ Advanced End ]->
default: {
core.warning(`The ${action} is not allowed.`);
Expand Down

0 comments on commit 65840f5

Please sign in to comment.