mirror of
https://github.com/actions/stale.git
synced 2025-12-11 20:47:10 +00:00
feat: remove the remove-stale-when-updated option
BREAKING CHANGE: The option remove-stale-when-updated was removed
This commit is contained in:
36
src/main.ts
36
src/main.ts
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user