mirror of
https://github.com/actions/stale.git
synced 2025-12-29 19:38:18 +00:00
Introducing sort-by option (#1254)
* sort-issues-by introduced * action.yml updated * pushing the build code * Update action.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update README.md for the new parameter (sort-issues-by) * minor text format changes in README.md * final draft of sort-issues-by * Update src/interfaces/issues-processor-options.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/classes/issues-processor.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactored the code * test * test * final changes * update in README.md * Documentation update * updated sort-issues-by to sort-by * minor changes * dist fixes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
11
src/main.ts
11
src/main.ts
@@ -97,6 +97,7 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
),
|
||||
debugOnly: core.getInput('debug-only') === 'true',
|
||||
ascending: core.getInput('ascending') === 'true',
|
||||
sortBy: _processParamtoString(core.getInput('sort-by')),
|
||||
deleteBranch: core.getInput('delete-branch') === 'true',
|
||||
startDate:
|
||||
core.getInput('start-date') !== ''
|
||||
@@ -198,4 +199,14 @@ function _toOptionalBoolean(
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function _processParamtoString(
|
||||
sortByValueInput: string
|
||||
): 'created' | 'updated' | 'comments' {
|
||||
return sortByValueInput === 'updated'
|
||||
? 'updated'
|
||||
: sortByValueInput === 'comments'
|
||||
? 'comments'
|
||||
: 'created';
|
||||
}
|
||||
|
||||
void _run();
|
||||
|
||||
Reference in New Issue
Block a user