From 580047f67fb01b18c3fa4e075e527c28d78bd591 Mon Sep 17 00:00:00 2001 From: Renan GEHAN Date: Fri, 5 Jan 2024 12:10:32 +0100 Subject: [PATCH] Add support for draft PRs --- src/providers/github/predicates/draft.ts | 13 +++++++++++++ src/providers/github/predicates/index.ts | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 src/providers/github/predicates/draft.ts diff --git a/src/providers/github/predicates/draft.ts b/src/providers/github/predicates/draft.ts new file mode 100644 index 00000000..c0523e83 --- /dev/null +++ b/src/providers/github/predicates/draft.ts @@ -0,0 +1,13 @@ +import { IDropdownPredicate, PredicateType } from '../../types'; + +export const draft: IDropdownPredicate = { + name: 'draft', + label: 'Is Draft?', + type: PredicateType.DROPDOWN, + choices: [ + { value: 'false', label: 'No' }, + { value: 'true', label: 'Yes' }, + ], + operators: [], + serialize: ({ value }) => `draft:${value}`, +}; diff --git a/src/providers/github/predicates/index.ts b/src/providers/github/predicates/index.ts index c2891a47..4fea4e2c 100644 --- a/src/providers/github/predicates/index.ts +++ b/src/providers/github/predicates/index.ts @@ -5,6 +5,7 @@ import { mergeStatus } from './mergeStatus'; import { review } from './review'; import { status } from './status'; import { type } from './type'; +import { draft } from "./draft"; enum GithubOperators { EQUAL = 'equal', @@ -120,4 +121,5 @@ export const availablePredicates: Predicate[] = [ status, mergeStatus, review, + draft, ];