feat(options): add new options to avoid stale base on comments (#494)

* feat(options): add new options to avoid stale based on comments

Helping to close #441, #470, #435?
Closes #390 due to no activity

BREAKING CHANGES: the options related to remove-stale-when-updated will only check the updates, not the comment. It is only impactint the configurations using the value at false

* style(readme): fix table syntax due to rebase

* docs(readme): add permissions only for the new options
This commit is contained in:
Geoffrey Testelin
2021-06-14 15:56:55 +02:00
committed by GitHub
parent f1017f33dd
commit 1efddcbe9f
12 changed files with 827 additions and 79 deletions

View File

@@ -11,7 +11,7 @@ let issuesProcessor: IssuesProcessorMock;
/**
* @description
* Assuming there is a comment on the issue
* Assuming there is an update on the issue
*/
describe('remove-stale-when-updated option', (): void => {
beforeEach((): void => {
@@ -480,8 +480,9 @@ class IssuesProcessorBuilder {
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z',
// Note this update
updated_at: new Date().toDateString(),
created_at: new Date().toDateString(),
labels: issue.labels?.map((label: Readonly<ILabel>): ILabel => {
return {
...label,
@@ -517,8 +518,9 @@ class IssuesProcessorBuilder {
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z',
// Note this update
updated_at: new Date().toDateString(),
created_at: new Date().toDateString(),
labels: issue.labels?.map((label: Readonly<ILabel>): ILabel => {
return {
...label,
@@ -541,14 +543,7 @@ class IssuesProcessorBuilder {
this._options,
async () => 'abot',
async p => (p === 1 ? this._issues : []),
async () => [
{
user: {
login: 'notme',
type: 'User'
}
}
],
async () => [],
async () => new Date().toDateString()
);
}