mirror of
https://github.com/actions/stale.git
synced 2025-12-28 19:18:16 +00:00
This reverts commit 1efddcbe9f.
This commit is contained in:
committed by
GitHub
parent
f2ae27a59b
commit
d3bfc50685
@@ -37,9 +37,6 @@ describe('Issue', (): void => {
|
||||
removeStaleWhenUpdated: false,
|
||||
removeIssueStaleWhenUpdated: undefined,
|
||||
removePrStaleWhenUpdated: undefined,
|
||||
removeStaleWhenCommented: false,
|
||||
removeIssueStaleWhenCommented: undefined,
|
||||
removePrStaleWhenCommented: undefined,
|
||||
repoToken: '',
|
||||
staleIssueMessage: '',
|
||||
stalePrMessage: '',
|
||||
|
||||
@@ -616,28 +616,7 @@ export class IssuesProcessor {
|
||||
);
|
||||
|
||||
if (shouldRemoveStaleWhenUpdated) {
|
||||
issueLogger.info(
|
||||
`The stale label should not be removed due to an update`
|
||||
);
|
||||
} else {
|
||||
issueLogger.info(
|
||||
`The stale label should be removed if all conditions met`
|
||||
);
|
||||
}
|
||||
|
||||
const shouldRemoveStaleWhenCommented: boolean =
|
||||
this._shouldRemoveStaleWhenCommented(issue);
|
||||
|
||||
issueLogger.info(
|
||||
`The option ${issueLogger.createOptionLink(
|
||||
this._getRemoveStaleWhenCommentedUsedOptionName(issue)
|
||||
)} is: ${LoggerService.cyan(shouldRemoveStaleWhenCommented)}`
|
||||
);
|
||||
|
||||
if (shouldRemoveStaleWhenCommented) {
|
||||
issueLogger.info(
|
||||
`The stale label should not be removed due to a comment`
|
||||
);
|
||||
issueLogger.info(`The stale label should not be removed`);
|
||||
} else {
|
||||
issueLogger.info(
|
||||
`The stale label should be removed if all conditions met`
|
||||
@@ -645,18 +624,9 @@ export class IssuesProcessor {
|
||||
}
|
||||
|
||||
// Should we un-stale this issue?
|
||||
if (shouldRemoveStaleWhenUpdated && issueHasUpdate) {
|
||||
if (shouldRemoveStaleWhenUpdated && issueHasComments) {
|
||||
issueLogger.info(
|
||||
`Remove the stale label since the $$type has an update and the workflow should remove the stale label when updated`
|
||||
);
|
||||
await this._removeStaleLabel(issue, staleLabel);
|
||||
|
||||
issueLogger.info(`Skipping the process since the $$type is now un-stale`);
|
||||
|
||||
return; // Nothing to do because it is no longer stale
|
||||
} else if (shouldRemoveStaleWhenCommented && issueHasComments) {
|
||||
issueLogger.info(
|
||||
`Remove the stale label since the $$type has a comment and the workflow should remove the stale label when commented`
|
||||
`Remove the stale label since the $$type has a comment and the workflow should remove the stale label when updated`
|
||||
);
|
||||
await this._removeStaleLabel(issue, staleLabel);
|
||||
|
||||
@@ -1076,22 +1046,6 @@ export class IssuesProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private _shouldRemoveStaleWhenCommented(issue: Issue): boolean {
|
||||
if (issue.isPullRequest) {
|
||||
if (isBoolean(this.options.removePrStaleWhenCommented)) {
|
||||
return this.options.removePrStaleWhenCommented;
|
||||
}
|
||||
|
||||
return this.options.removeStaleWhenCommented;
|
||||
}
|
||||
|
||||
if (isBoolean(this.options.removeIssueStaleWhenCommented)) {
|
||||
return this.options.removeIssueStaleWhenCommented;
|
||||
}
|
||||
|
||||
return this.options.removeStaleWhenCommented;
|
||||
}
|
||||
|
||||
private async _removeStaleLabel(
|
||||
issue: Issue,
|
||||
staleLabel: Readonly<string>
|
||||
@@ -1203,25 +1157,4 @@ export class IssuesProcessor {
|
||||
|
||||
return Option.RemoveStaleWhenUpdated;
|
||||
}
|
||||
|
||||
private _getRemoveStaleWhenCommentedUsedOptionName(
|
||||
issue: Readonly<Issue>
|
||||
):
|
||||
| Option.RemovePrStaleWhenCommented
|
||||
| Option.RemoveStaleWhenCommented
|
||||
| Option.RemoveIssueStaleWhenCommented {
|
||||
if (issue.isPullRequest) {
|
||||
if (isBoolean(this.options.removePrStaleWhenCommented)) {
|
||||
return Option.RemovePrStaleWhenCommented;
|
||||
}
|
||||
|
||||
return Option.RemoveStaleWhenCommented;
|
||||
}
|
||||
|
||||
if (isBoolean(this.options.removeIssueStaleWhenCommented)) {
|
||||
return Option.RemoveIssueStaleWhenCommented;
|
||||
}
|
||||
|
||||
return Option.RemoveStaleWhenCommented;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,6 @@ export enum Option {
|
||||
RemoveStaleWhenUpdated = 'remove-stale-when-updated',
|
||||
RemoveIssueStaleWhenUpdated = 'remove-issue-stale-when-updated',
|
||||
RemovePrStaleWhenUpdated = 'remove-pr-stale-when-updated',
|
||||
RemoveStaleWhenCommented = 'remove-stale-when-commented',
|
||||
RemoveIssueStaleWhenCommented = 'remove-issue-stale-when-commented',
|
||||
RemovePrStaleWhenCommented = 'remove-pr-stale-when-commented',
|
||||
DebugOnly = 'debug-only',
|
||||
Ascending = 'ascending',
|
||||
DeleteBranch = 'delete-branch',
|
||||
|
||||
@@ -28,9 +28,6 @@ export interface IIssuesProcessorOptions {
|
||||
removeStaleWhenUpdated: boolean;
|
||||
removeIssueStaleWhenUpdated: boolean | undefined;
|
||||
removePrStaleWhenUpdated: boolean | undefined;
|
||||
removeStaleWhenCommented: boolean;
|
||||
removeIssueStaleWhenCommented: boolean | undefined;
|
||||
removePrStaleWhenCommented: boolean | undefined;
|
||||
debugOnly: boolean;
|
||||
ascending: boolean;
|
||||
deleteBranch: boolean;
|
||||
|
||||
@@ -62,15 +62,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
removePrStaleWhenUpdated: _toOptionalBoolean(
|
||||
core.getInput('remove-pr-stale-when-updated')
|
||||
),
|
||||
removeStaleWhenCommented: !(
|
||||
core.getInput('remove-stale-when-commented') === 'false'
|
||||
),
|
||||
removeIssueStaleWhenCommented: _toOptionalBoolean(
|
||||
core.getInput('remove-issue-stale-when-commented')
|
||||
),
|
||||
removePrStaleWhenCommented: _toOptionalBoolean(
|
||||
core.getInput('remove-pr-stale-when-commented')
|
||||
),
|
||||
debugOnly: core.getInput('debug-only') === 'true',
|
||||
ascending: core.getInput('ascending') === 'true',
|
||||
deleteBranch: core.getInput('delete-branch') === 'true',
|
||||
|
||||
Reference in New Issue
Block a user