feat: remove the remove-stale-when-updated option

BREAKING CHANGE:
The option remove-stale-when-updated was removed
This commit is contained in:
TESTELIN Geoffrey
2021-10-08 21:30:39 +02:00
parent bab816b473
commit b9a40762bf
11 changed files with 361 additions and 753 deletions

View File

@@ -53,14 +53,11 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
operationsPerRun: parseInt(
core.getInput('operations-per-run', {required: true})
),
removeStaleWhenUpdated: !(
core.getInput('remove-stale-when-updated') === 'false'
removeIssueStaleWhenUpdated: !(
core.getInput('remove-issue-stale-when-updated') === 'false'
),
removeIssueStaleWhenUpdated: _toOptionalBoolean(
'remove-issue-stale-when-updated'
),
removePrStaleWhenUpdated: _toOptionalBoolean(
'remove-pr-stale-when-updated'
removePrStaleWhenUpdated: !(
core.getInput('remove-pr-stale-when-updated') === 'false'
),
debugOnly: core.getInput('debug-only') === 'true',
ascending: core.getInput('ascending') === 'true',
@@ -123,29 +120,4 @@ async function processOutput(
core.setOutput('closed-issues-prs', JSON.stringify(closedIssues));
}
/**
* @description
* From an argument name, get the value as an optional boolean
* This is very useful for all the arguments that override others
* It will allow us to easily use the original one when the return value is `undefined`
* Which is different from `true` or `false` that consider the argument as set
*
* @param {Readonly<string>} argumentName The name of the argument to check
*
* @returns {boolean | undefined} The value matching the given argument name
*/
function _toOptionalBoolean(
argumentName: Readonly<string>
): boolean | undefined {
const argument: string = core.getInput(argumentName);
if (argument === 'true') {
return true;
} else if (argument === 'false') {
return false;
}
return undefined;
}
void _run();