feat: remove the exempt-all-milestones option
BREAKING CHANGE: The option exempt-all-milestones was removed
This commit is contained in:
parent
4665995b65
commit
315391885d
116
README.md
116
README.md
|
@ -28,55 +28,54 @@ You can find more information about the required permissions under the correspon
|
|||
|
||||
Every argument is optional.
|
||||
|
||||
| Input | Description | Default |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------- |
|
||||
| [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` |
|
||||
| [days-before-stale](#days-before-stale) | Idle number of days before marking issues/PRs stale | `60` |
|
||||
| [days-before-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | |
|
||||
| [days-before-pr-stale](#days-before-pr-stale) | Override [days-before-stale](#days-before-stale) for PRs only | |
|
||||
| [days-before-close](#days-before-close) | Idle number of days before closing stale issues/PRs | `7` |
|
||||
| [days-before-issue-close](#days-before-issue-close) | Override [days-before-close](#days-before-close) for issues only | |
|
||||
| [days-before-pr-close](#days-before-pr-close) | Override [days-before-close](#days-before-close) for PRs only | |
|
||||
| [stale-issue-message](#stale-issue-message) | Comment on the staled issues | |
|
||||
| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | |
|
||||
| [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | |
|
||||
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
|
||||
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
|
||||
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
|
||||
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
|
||||
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
|
||||
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
|
||||
| [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | |
|
||||
| [only-labels](#only-labels) | Only issues/PRs with ALL these labels are checked | |
|
||||
| [only-issue-labels](#only-issue-labels) | Override [only-labels](#only-labels) for issues only | |
|
||||
| [only-pr-labels](#only-pr-labels) | Override [only-labels](#only-labels) for PRs only | |
|
||||
| [any-of-labels](#any-of-labels) | Only issues/PRs with ANY of these labels are checked | |
|
||||
| [any-of-issue-labels](#any-of-issue-labels) | Override [any-of-labels](#any-of-labels) for issues only | |
|
||||
| [any-of-pr-labels](#any-of-pr-labels) | Override [any-of-labels](#any-of-labels) for PRs only | |
|
||||
| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` |
|
||||
| [remove-stale-when-updated](#remove-stale-when-updated) | Remove stale label from issues/PRs on updates | `true` |
|
||||
| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | |
|
||||
| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | |
|
||||
| [labels-to-add-when-unstale](#labels-to-add-when-unstale) | Add specified labels from issues/PRs when they become unstale | |
|
||||
| [labels-to-remove-when-unstale](#labels-to-remove-when-unstale) | Remove specified labels from issues/PRs when they become unstale | |
|
||||
| [debug-only](#debug-only) | Dry-run | `false` |
|
||||
| [ascending](#ascending) | Order to get issues/PRs | `false` |
|
||||
| [start-date](#start-date) | Skip stale action for issues/PRs created before it | |
|
||||
| [delete-branch](#delete-branch) | Delete branch after closing a stale PR | `false` |
|
||||
| [exempt-milestones](#exempt-milestones) | Milestones on issues/PRs exempted from stale | |
|
||||
| [exempt-issue-milestones](#exempt-issue-milestones) | Override [exempt-milestones](#exempt-milestones) for issues only | |
|
||||
| [exempt-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | |
|
||||
| [exempt-all-milestones](#exempt-all-milestones) | Exempt all issues/PRs with milestones from stale | `false` |
|
||||
| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for issues only | |
|
||||
| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for PRs only | |
|
||||
| [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | |
|
||||
| [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | |
|
||||
| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` |
|
||||
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `false` |
|
||||
| [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` |
|
||||
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
|
||||
| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` |
|
||||
| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` |
|
||||
| Input | Description | Default |
|
||||
| ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | ------- |
|
||||
| [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` |
|
||||
| [days-before-stale](#days-before-stale) | Idle number of days before marking issues/PRs stale | `60` |
|
||||
| [days-before-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | |
|
||||
| [days-before-pr-stale](#days-before-pr-stale) | Override [days-before-stale](#days-before-stale) for PRs only | |
|
||||
| [days-before-close](#days-before-close) | Idle number of days before closing stale issues/PRs | `7` |
|
||||
| [days-before-issue-close](#days-before-issue-close) | Override [days-before-close](#days-before-close) for issues only | |
|
||||
| [days-before-pr-close](#days-before-pr-close) | Override [days-before-close](#days-before-close) for PRs only | |
|
||||
| [stale-issue-message](#stale-issue-message) | Comment on the staled issues | |
|
||||
| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | |
|
||||
| [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | |
|
||||
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
|
||||
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
|
||||
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
|
||||
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
|
||||
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
|
||||
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
|
||||
| [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | |
|
||||
| [only-labels](#only-labels) | Only issues/PRs with ALL these labels are checked | |
|
||||
| [only-issue-labels](#only-issue-labels) | Override [only-labels](#only-labels) for issues only | |
|
||||
| [only-pr-labels](#only-pr-labels) | Override [only-labels](#only-labels) for PRs only | |
|
||||
| [any-of-labels](#any-of-labels) | Only issues/PRs with ANY of these labels are checked | |
|
||||
| [any-of-issue-labels](#any-of-issue-labels) | Override [any-of-labels](#any-of-labels) for issues only | |
|
||||
| [any-of-pr-labels](#any-of-pr-labels) | Override [any-of-labels](#any-of-labels) for PRs only | |
|
||||
| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` |
|
||||
| [remove-stale-when-updated](#remove-stale-when-updated) | Remove stale label from issues/PRs on updates | `true` |
|
||||
| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | |
|
||||
| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | |
|
||||
| [labels-to-add-when-unstale](#labels-to-add-when-unstale) | Add specified labels from issues/PRs when they become unstale | |
|
||||
| [labels-to-remove-when-unstale](#labels-to-remove-when-unstale) | Remove specified labels from issues/PRs when they become unstale | |
|
||||
| [debug-only](#debug-only) | Dry-run | `false` |
|
||||
| [ascending](#ascending) | Order to get issues/PRs | `false` |
|
||||
| [start-date](#start-date) | Skip stale action for issues/PRs created before it | |
|
||||
| [delete-branch](#delete-branch) | Delete branch after closing a stale PR | `false` |
|
||||
| [exempt-milestones](#exempt-milestones) | Milestones on issues/PRs exempted from stale | |
|
||||
| [exempt-issue-milestones](#exempt-issue-milestones) | Override [exempt-milestones](#exempt-milestones) for issues only | |
|
||||
| [exempt-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | |
|
||||
| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | | `false` |
|
||||
| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Exempt all PRs with milestones from stale | | `false` |
|
||||
| [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | |
|
||||
| [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | |
|
||||
| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` |
|
||||
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `false` |
|
||||
| [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` |
|
||||
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
|
||||
| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` |
|
||||
| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` |
|
||||
|
||||
### List of output options
|
||||
|
||||
|
@ -122,7 +121,8 @@ You can fine tune which issues or pull requests should be marked as stale based
|
|||
- [any-of-labels](#any-of-labels)
|
||||
- [start-date](#start-date)
|
||||
- [exempt-milestones](#exempt-milestones)
|
||||
- [exempt-all-milestones](#exempt-all-milestones)
|
||||
- [exempt-all-issue-milestones](#exempt-all-issue-milestones)
|
||||
- [exempt-all-pr-milestones](#exempt-all-pr-milestones)
|
||||
- [exempt-issue-assignees](#exempt-issue-assignees)
|
||||
- [exempt-pr-assignees](#exempt-pr-assignees)
|
||||
- [exempt-all-issue-assignees](#exempt-all-issue-assignees)
|
||||
|
@ -412,25 +412,21 @@ Override [exempt-milestones](#exempt-milestones) but only to process the pull re
|
|||
|
||||
Default value: unset
|
||||
|
||||
#### exempt-all-milestones
|
||||
#### exempt-all-issue-milestones
|
||||
|
||||
If set to `true`, the issues or the pull requests with a milestone will not be marked as stale automatically.
|
||||
If set to `true`, the issues with a milestone will not be marked as stale automatically.
|
||||
|
||||
Priority over [exempt-milestones](#exempt-milestones).
|
||||
|
||||
Default value: `false`
|
||||
|
||||
#### exempt-all-issue-milestones
|
||||
|
||||
Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the issues with a milestone to be marked as stale automatically.
|
||||
|
||||
Default value: unset
|
||||
|
||||
#### exempt-all-pr-milestones
|
||||
|
||||
Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the pull requests with a milestone to be marked as stale automatically.
|
||||
If set to `true`, the pull requests with a milestone will not be marked as stale automatically.
|
||||
|
||||
Default value: unset
|
||||
Priority over [exempt-milestones](#exempt-milestones).
|
||||
|
||||
Default value: `false`
|
||||
|
||||
#### exempt-issue-assignees
|
||||
|
||||
|
|
|
@ -35,9 +35,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
|
|||
exemptMilestones: '',
|
||||
exemptIssueMilestones: '',
|
||||
exemptPrMilestones: '',
|
||||
exemptAllMilestones: false,
|
||||
exemptAllIssueMilestones: undefined,
|
||||
exemptAllPrMilestones: undefined,
|
||||
exemptAllIssueMilestones: false,
|
||||
exemptAllPrMilestones: false,
|
||||
exemptAssignees: '',
|
||||
exemptIssueAssignees: '',
|
||||
exemptPrAssignees: '',
|
||||
|
|
File diff suppressed because it is too large
Load Diff
12
action.yml
12
action.yml
|
@ -72,17 +72,13 @@ inputs:
|
|||
description: 'The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests.'
|
||||
default: ''
|
||||
required: false
|
||||
exempt-all-milestones:
|
||||
description: 'Exempt all issues and pull requests with milestones from being marked as stale. Default to false.'
|
||||
exempt-all-issue-milestones:
|
||||
description: 'Exempt all issues with milestones from being marked as stale. Default to false.'
|
||||
default: 'false'
|
||||
required: false
|
||||
exempt-all-issue-milestones:
|
||||
description: 'Exempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues.'
|
||||
default: ''
|
||||
required: false
|
||||
exempt-all-pr-milestones:
|
||||
description: 'Exempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests.'
|
||||
default: ''
|
||||
description: 'Exempt all pull requests with milestones from being marked as stale. Default to false.'
|
||||
default: 'false'
|
||||
required: false
|
||||
only-labels:
|
||||
description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.'
|
||||
|
|
|
@ -1315,36 +1315,20 @@ class Milestones {
|
|||
return false;
|
||||
}
|
||||
_shouldExemptAllIssueMilestones() {
|
||||
if (this._options.exemptAllIssueMilestones === true) {
|
||||
if (this._options.exemptAllIssueMilestones) {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is enabled. Any milestone on this $$type will skip the stale process`);
|
||||
return true;
|
||||
}
|
||||
else if (this._options.exemptAllIssueMilestones === false) {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`);
|
||||
return false;
|
||||
}
|
||||
this._logExemptAllMilestonesOption();
|
||||
return this._options.exemptAllMilestones;
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`);
|
||||
return false;
|
||||
}
|
||||
_shouldExemptAllPullRequestMilestones() {
|
||||
if (this._options.exemptAllPrMilestones === true) {
|
||||
if (this._options.exemptAllPrMilestones) {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is enabled. Any milestone on this $$type will skip the stale process`);
|
||||
return true;
|
||||
}
|
||||
else if (this._options.exemptAllPrMilestones === false) {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`);
|
||||
return false;
|
||||
}
|
||||
this._logExemptAllMilestonesOption();
|
||||
return this._options.exemptAllMilestones;
|
||||
}
|
||||
_logExemptAllMilestonesOption() {
|
||||
if (this._options.exemptAllMilestones) {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is enabled. Any milestone on this $$type will skip the stale process`);
|
||||
}
|
||||
else {
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`);
|
||||
}
|
||||
this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`);
|
||||
return false;
|
||||
}
|
||||
_logSkip() {
|
||||
this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the milestones checks');
|
||||
|
@ -1814,7 +1798,6 @@ var Option;
|
|||
Option["ExemptMilestones"] = "exempt-milestones";
|
||||
Option["ExemptIssueMilestones"] = "exempt-issue-milestones";
|
||||
Option["ExemptPrMilestones"] = "exempt-pr-milestones";
|
||||
Option["ExemptAllMilestones"] = "exempt-all-milestones";
|
||||
Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones";
|
||||
Option["ExemptAllPrMilestones"] = "exempt-all-pr-milestones";
|
||||
Option["ExemptIssueAssignees"] = "exempt-issue-assignees";
|
||||
|
@ -2122,9 +2105,8 @@ function _getAndValidateArgs() {
|
|||
exemptMilestones: core.getInput('exempt-milestones'),
|
||||
exemptIssueMilestones: core.getInput('exempt-issue-milestones'),
|
||||
exemptPrMilestones: core.getInput('exempt-pr-milestones'),
|
||||
exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true',
|
||||
exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'),
|
||||
exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'),
|
||||
exemptAllIssueMilestones: core.getInput('exempt-all-issue-milestones') === 'true',
|
||||
exemptAllPrMilestones: core.getInput('exempt-all-pr-milestones') === 'true',
|
||||
exemptIssueAssignees: core.getInput('exempt-issue-assignees'),
|
||||
exemptPrAssignees: core.getInput('exempt-pr-assignees'),
|
||||
exemptAllIssueAssignees: core.getInput('exempt-all-issue-assignees') === 'true',
|
||||
|
|
|
@ -46,9 +46,8 @@ describe('Issue', (): void => {
|
|||
exemptMilestones: '',
|
||||
exemptIssueMilestones: '',
|
||||
exemptPrMilestones: '',
|
||||
exemptAllMilestones: false,
|
||||
exemptAllIssueMilestones: undefined,
|
||||
exemptAllPrMilestones: undefined,
|
||||
exemptAllIssueMilestones: false,
|
||||
exemptAllPrMilestones: false,
|
||||
exemptIssueAssignees: '',
|
||||
exemptPrAssignees: '',
|
||||
exemptAllIssueAssignees: false,
|
||||
|
|
|
@ -12,7 +12,11 @@ describe('Milestones', (): void => {
|
|||
let issueInterface: IIssue;
|
||||
|
||||
beforeEach((): void => {
|
||||
optionsInterface = {...DefaultProcessorOptions, exemptAllMilestones: false};
|
||||
optionsInterface = {
|
||||
...DefaultProcessorOptions,
|
||||
exemptAllIssueAssignees: false,
|
||||
exemptAllPrMilestones: false
|
||||
};
|
||||
issueInterface = generateIIssue();
|
||||
});
|
||||
|
||||
|
@ -286,9 +290,49 @@ describe('Milestones', (): void => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all milestones', (): void => {
|
||||
describe('when the given options are not configured to exempt all issue milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllMilestones = true;
|
||||
optionsInterface.exemptAllIssueMilestones = false;
|
||||
});
|
||||
|
||||
describe('when the given issue does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given issue does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all issue milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllIssueMilestones = true;
|
||||
});
|
||||
|
||||
describe('when the given issue does not have a milestone', (): void => {
|
||||
|
@ -324,86 +368,6 @@ describe('Milestones', (): void => {
|
|||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are not configured to exempt all issue milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllIssueMilestones = false;
|
||||
});
|
||||
|
||||
describe('when the given issue does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given issue does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all issue milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllIssueMilestones = true;
|
||||
});
|
||||
|
||||
describe('when the given issue does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given issue does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-issue-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return true', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -674,9 +638,49 @@ describe('Milestones', (): void => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all milestones', (): void => {
|
||||
describe('when the given options are not configured to exempt all pull request milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllMilestones = true;
|
||||
optionsInterface.exemptAllPrMilestones = false;
|
||||
});
|
||||
|
||||
describe('when the given pull request does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given pull request does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all pull request milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllPrMilestones = true;
|
||||
});
|
||||
|
||||
describe('when the given pull request does not have a milestone', (): void => {
|
||||
|
@ -712,86 +716,6 @@ describe('Milestones', (): void => {
|
|||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are not configured to exempt all pull request milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllPrMilestones = false;
|
||||
});
|
||||
|
||||
describe('when the given pull request does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given pull request does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given options are configured to exempt all pull request milestones', (): void => {
|
||||
beforeEach((): void => {
|
||||
optionsInterface.exemptAllPrMilestones = true;
|
||||
});
|
||||
|
||||
describe('when the given pull request does not have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = undefined;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given pull request does have a milestone', (): void => {
|
||||
beforeEach((): void => {
|
||||
issueInterface.milestone = {
|
||||
title: 'dummy-exempt-pr-milestone'
|
||||
};
|
||||
});
|
||||
|
||||
it('should return true', (): void => {
|
||||
expect.assertions(1);
|
||||
issue = new Issue(optionsInterface, issueInterface);
|
||||
milestones = new Milestones(optionsInterface, issue);
|
||||
|
||||
const result = milestones.shouldExemptMilestones();
|
||||
|
||||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -225,7 +225,7 @@ export class Milestones {
|
|||
}
|
||||
|
||||
private _shouldExemptAllIssueMilestones(): boolean {
|
||||
if (this._options.exemptAllIssueMilestones === true) {
|
||||
if (this._options.exemptAllIssueMilestones) {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllIssueMilestones
|
||||
|
@ -233,23 +233,19 @@ export class Milestones {
|
|||
);
|
||||
|
||||
return true;
|
||||
} else if (this._options.exemptAllIssueMilestones === false) {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllIssueMilestones
|
||||
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
this._logExemptAllMilestonesOption();
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllIssueMilestones
|
||||
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
|
||||
);
|
||||
|
||||
return this._options.exemptAllMilestones;
|
||||
return false;
|
||||
}
|
||||
|
||||
private _shouldExemptAllPullRequestMilestones(): boolean {
|
||||
if (this._options.exemptAllPrMilestones === true) {
|
||||
if (this._options.exemptAllPrMilestones) {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllPrMilestones
|
||||
|
@ -257,35 +253,15 @@ export class Milestones {
|
|||
);
|
||||
|
||||
return true;
|
||||
} else if (this._options.exemptAllPrMilestones === false) {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllPrMilestones
|
||||
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
this._logExemptAllMilestonesOption();
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllPrMilestones
|
||||
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
|
||||
);
|
||||
|
||||
return this._options.exemptAllMilestones;
|
||||
}
|
||||
|
||||
private _logExemptAllMilestonesOption(): void {
|
||||
if (this._options.exemptAllMilestones) {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllMilestones
|
||||
)} is enabled. Any milestone on this $$type will skip the stale process`
|
||||
);
|
||||
} else {
|
||||
this._issueLogger.info(
|
||||
`The option ${this._issueLogger.createOptionLink(
|
||||
Option.ExemptAllMilestones
|
||||
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private _logSkip(): void {
|
||||
|
|
|
@ -31,7 +31,6 @@ export enum Option {
|
|||
ExemptMilestones = 'exempt-milestones',
|
||||
ExemptIssueMilestones = 'exempt-issue-milestones',
|
||||
ExemptPrMilestones = 'exempt-pr-milestones',
|
||||
ExemptAllMilestones = 'exempt-all-milestones',
|
||||
ExemptAllIssueMilestones = 'exempt-all-issue-milestones',
|
||||
ExemptAllPrMilestones = 'exempt-all-pr-milestones',
|
||||
ExemptIssueAssignees = 'exempt-issue-assignees',
|
||||
|
|
|
@ -35,9 +35,8 @@ export interface IIssuesProcessorOptions {
|
|||
exemptMilestones: string;
|
||||
exemptIssueMilestones: string;
|
||||
exemptPrMilestones: string;
|
||||
exemptAllMilestones: boolean;
|
||||
exemptAllIssueMilestones: boolean | undefined;
|
||||
exemptAllPrMilestones: boolean | undefined;
|
||||
exemptAllIssueMilestones: boolean;
|
||||
exemptAllPrMilestones: boolean;
|
||||
exemptIssueAssignees: string;
|
||||
exemptPrAssignees: string;
|
||||
exemptAllIssueAssignees: boolean;
|
||||
|
|
|
@ -72,9 +72,9 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
|||
exemptMilestones: core.getInput('exempt-milestones'),
|
||||
exemptIssueMilestones: core.getInput('exempt-issue-milestones'),
|
||||
exemptPrMilestones: core.getInput('exempt-pr-milestones'),
|
||||
exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true',
|
||||
exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'),
|
||||
exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'),
|
||||
exemptAllIssueMilestones:
|
||||
core.getInput('exempt-all-issue-milestones') === 'true',
|
||||
exemptAllPrMilestones: core.getInput('exempt-all-pr-milestones') === 'true',
|
||||
exemptIssueAssignees: core.getInput('exempt-issue-assignees'),
|
||||
exemptPrAssignees: core.getInput('exempt-pr-assignees'),
|
||||
exemptAllIssueAssignees:
|
||||
|
|
Loading…
Reference in New Issue