@@ -382,6 +382,7 @@ const statistics_1 = __nccwpck_require__(3334);
382382const logger_service_1 = __nccwpck_require__(1973);
383383const plugin_retry_1 = __nccwpck_require__(6298);
384384const rate_limit_1 = __nccwpck_require__(7069);
385+ const get_sort_field_1 = __nccwpck_require__(9551);
385386/***
386387 * Handle processing of issues for staleness/closure.
387388 */
@@ -684,6 +685,7 @@ class IssuesProcessor {
684685 state: 'open',
685686 per_page: 100,
686687 direction: this.options.ascending ? 'asc' : 'desc',
688+ sort: (0, get_sort_field_1.getSortField)(this.options.sortBy),
687689 page
688690 });
689691 (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCount(issueResult.data.length);
@@ -2199,6 +2201,7 @@ var Option;
21992201 Option["RemovePrStaleWhenUpdated"] = "remove-pr-stale-when-updated";
22002202 Option["DebugOnly"] = "debug-only";
22012203 Option["Ascending"] = "ascending";
2204+ Option["SortBy"] = "sort-by";
22022205 Option["DeleteBranch"] = "delete-branch";
22032206 Option["StartDate"] = "start-date";
22042207 Option["ExemptMilestones"] = "exempt-milestones";
@@ -2333,6 +2336,25 @@ function isValidDate(date) {
23332336exports.isValidDate = isValidDate;
23342337
23352338
2339+ /***/ }),
2340+
2341+ /***/ 9551:
2342+ /***/ ((__unused_webpack_module, exports) => {
2343+
2344+ "use strict";
2345+
2346+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2347+ exports.getSortField = void 0;
2348+ function getSortField(sortOption) {
2349+ return sortOption === 'updated'
2350+ ? 'updated'
2351+ : sortOption === 'comments'
2352+ ? 'comments'
2353+ : 'created';
2354+ }
2355+ exports.getSortField = getSortField;
2356+
2357+
23362358/***/ }),
23372359
23382360/***/ 8236:
@@ -2542,6 +2564,7 @@ function _getAndValidateArgs() {
25422564 removePrStaleWhenUpdated: _toOptionalBoolean('remove-pr-stale-when-updated'),
25432565 debugOnly: core.getInput('debug-only') === 'true',
25442566 ascending: core.getInput('ascending') === 'true',
2567+ sortBy: _processParamtoString(core.getInput('sort-by')),
25452568 deleteBranch: core.getInput('delete-branch') === 'true',
25462569 startDate: core.getInput('start-date') !== ''
25472570 ? core.getInput('start-date')
@@ -2628,6 +2651,13 @@ function _toOptionalBoolean(argumentName) {
26282651 }
26292652 return undefined;
26302653}
2654+ function _processParamtoString(sortByValueInput) {
2655+ return sortByValueInput === 'updated'
2656+ ? 'updated'
2657+ : sortByValueInput === 'comments'
2658+ ? 'comments'
2659+ : 'created';
2660+ }
26312661void _run();
26322662
26332663
0 commit comments