node-gitlab-2-github
node-gitlab-2-github copied to clipboard
Filter gitlab objects with functions
I think it would be really nice to remove the settings for skipping item states and replace them with filter functions.
Now:
skipMergeRequestStates: string[];
skipMatchingComments: string[];
Suggested:
skipIssue: (issue: GitLabIssue) => boolean;
skipMergeRequest: (mr: GitLabMergeRequest) => boolean;
skipNotes: (note: GitLabNote) => boolean;
skipMilestone: (note: GitLabMilestone) => boolean;
An example config could be:
skipMergeRequest: (mr: GitLabMergeRequest) => ['merged', 'closed'].includes(mr.state),
skipIssue: (issue: GitLabIssue) => {
if (!issue.closed_at) {
return false;
}
return (new Date(issue.closed_at)).getFullYear() < 2023;
},