mirror of
https://github.com/actions/stale.git
synced 2025-12-10 20:21:20 +00:00
feat(assignees): add 6 new options to avoid stale for assignees (#327)
* feat(assignees): add new option to avoid stale for assignees closes #271 * test: add more coverage * docs: fix readme format issue * docs: reorder and enhance typo * docs(contributing): add more information about the npm scripts
This commit is contained in:
committed by
GitHub
parent
996798eb71
commit
ec96ff65b0
19
__tests__/functions/generate-iissue.ts
Normal file
19
__tests__/functions/generate-iissue.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import {IIssue} from '../../src/interfaces/issue';
|
||||
|
||||
export function generateIIssue(
|
||||
partialIssue?: Readonly<Partial<IIssue>>
|
||||
): IIssue {
|
||||
return {
|
||||
milestone: undefined,
|
||||
assignees: [],
|
||||
labels: [],
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
number: Math.round(Math.random() * 5000),
|
||||
pull_request: null,
|
||||
title: 'dummy-title',
|
||||
locked: false,
|
||||
state: 'dummy-state',
|
||||
...partialIssue
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import {Issue} from '../../src/classes/issue';
|
||||
import {IAssignee} from '../../src/interfaces/assignee';
|
||||
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
|
||||
import {IsoDateString} from '../../src/types/iso-date-string';
|
||||
|
||||
@@ -12,7 +13,8 @@ export function generateIssue(
|
||||
labels: string[] = [],
|
||||
isClosed = false,
|
||||
isLocked = false,
|
||||
milestone: string | undefined = undefined
|
||||
milestone: string | undefined = undefined,
|
||||
assignees: string[] = []
|
||||
): Issue {
|
||||
return new Issue(options, {
|
||||
number: id,
|
||||
@@ -29,6 +31,13 @@ export function generateIssue(
|
||||
? {
|
||||
title: milestone
|
||||
}
|
||||
: undefined
|
||||
: undefined,
|
||||
assignees: assignees.map(
|
||||
(assignee: Readonly<string>): IAssignee => {
|
||||
return {
|
||||
login: assignee
|
||||
};
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user