feat: remove the any-of-labels option

BREAKING CHANGE:
The option any-of-labels was removed
This commit is contained in:
TESTELIN Geoffrey
2021-10-08 20:18:01 +02:00
parent f6a70aa856
commit 1c81c38e2f
9 changed files with 562 additions and 1195 deletions

View File

@@ -30,7 +30,6 @@ describe('Issue', (): void => {
onlyLabels: '',
onlyIssueLabels: '',
onlyPrLabels: '',
anyOfLabels: '',
anyOfIssueLabels: '',
anyOfPrLabels: '',
operationsPerRun: 0,

View File

@@ -345,7 +345,7 @@ export class IssuesProcessor {
if (anyOfLabels.length > 0) {
issueLogger.info(
`The option ${issueLogger.createOptionLink(
Option.AnyOfLabels
issue.isPullRequest ? Option.AnyOfPrLabels : Option.AnyOfIssueLabels
)} was specified to only process the issues and pull requests with one of those labels (${LoggerService.cyan(
anyOfLabels.length
)})`
@@ -377,7 +377,7 @@ export class IssuesProcessor {
} else {
issueLogger.info(
`The option ${issueLogger.createOptionLink(
Option.AnyOfLabels
issue.isPullRequest ? Option.AnyOfPrLabels : Option.AnyOfIssueLabels
)} was not specified`
);
issueLogger.info(
@@ -997,16 +997,10 @@ export class IssuesProcessor {
private _getAnyOfLabels(issue: Issue): string {
if (issue.isPullRequest) {
if (this.options.anyOfPrLabels !== '') {
return this.options.anyOfPrLabels;
}
} else {
if (this.options.anyOfIssueLabels !== '') {
return this.options.anyOfIssueLabels;
}
return this.options.anyOfPrLabels;
}
return this.options.anyOfLabels;
return this.options.anyOfIssueLabels;
}
private _shouldRemoveStaleWhenUpdated(issue: Issue): boolean {

View File

@@ -19,7 +19,8 @@ export enum Option {
OnlyLabels = 'only-labels',
OnlyIssueLabels = 'only-issue-labels',
OnlyPrLabels = 'only-pr-labels',
AnyOfLabels = 'any-of-labels',
AnyOfIssueLabels = 'any-of-issue-labels',
AnyOfPrLabels = 'any-of-pr-labels',
OperationsPerRun = 'operations-per-run',
RemoveStaleWhenUpdated = 'remove-stale-when-updated',
RemoveIssueStaleWhenUpdated = 'remove-issue-stale-when-updated',

View File

@@ -21,7 +21,6 @@ export interface IIssuesProcessorOptions {
onlyLabels: string;
onlyIssueLabels: string;
onlyPrLabels: string;
anyOfLabels: string;
anyOfIssueLabels: string;
anyOfPrLabels: string;
operationsPerRun: number;

View File

@@ -47,7 +47,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
onlyLabels: core.getInput('only-labels'),
onlyIssueLabels: core.getInput('only-issue-labels'),
onlyPrLabels: core.getInput('only-pr-labels'),
anyOfLabels: core.getInput('any-of-labels'),
anyOfIssueLabels: core.getInput('any-of-issue-labels'),
anyOfPrLabels: core.getInput('any-of-pr-labels'),
operationsPerRun: parseInt(