mirror of
https://github.com/actions/stale.git
synced 2025-12-10 03:57:04 +00:00
* refactor: move and rename the interfaces/classes closes #272 * docs: update the readme and action to describe the new options for milestones * refactor: split the tests into multiple files * feat(milestones): add new options to exempt all milestones * test: add coverage for the default values * test(milestones): add more coverage (wip) * test(milestones): add more coverage for the multiple exempt milestones * test: reduce duplicated code * test: change some describes * test: add more coverage * test: add more coverage * test: add final coverage * build(tsc): add missing project flag to build with the right tsconfig * test(milestones): use each to reduce the complexity of the tests * chore: fix an eslint issue with prettier on windows the end of line was wrong each time the os process the files * docs: move the contribution section to a dedicated file add more content to help the debug * chore: make sure the rebase is ok
35 lines
888 B
TypeScript
35 lines
888 B
TypeScript
import {Issue} from '../../src/classes/issue';
|
|
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
|
|
import {IsoDateString} from '../../src/types/iso-date-string';
|
|
|
|
export function generateIssue(
|
|
options: IIssuesProcessorOptions,
|
|
id: number,
|
|
title: string,
|
|
updatedAt: IsoDateString,
|
|
createdAt: IsoDateString = updatedAt,
|
|
isPullRequest = false,
|
|
labels: string[] = [],
|
|
isClosed = false,
|
|
isLocked = false,
|
|
milestone: string | undefined = undefined
|
|
): Issue {
|
|
return new Issue(options, {
|
|
number: id,
|
|
labels: labels.map(l => {
|
|
return {name: l};
|
|
}),
|
|
title,
|
|
created_at: createdAt,
|
|
updated_at: updatedAt,
|
|
pull_request: isPullRequest ? {} : null,
|
|
state: isClosed ? 'closed' : 'open',
|
|
locked: isLocked,
|
|
milestone: milestone
|
|
? {
|
|
title: milestone
|
|
}
|
|
: undefined
|
|
});
|
|
}
|