From 33ffddc3dd16077f8a327f8178c9b5b6dcf70321 Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Tue, 26 Jan 2021 11:20:51 -0700 Subject: [PATCH] Ignore draft PRs outside of the project board --- src/queries/all-open-prs-query.ts | 3 ++- src/queries/schema/GetAllOpenPRsAndCardIDs.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/queries/all-open-prs-query.ts b/src/queries/all-open-prs-query.ts index 80e5c1ec5..491ad9600 100644 --- a/src/queries/all-open-prs-query.ts +++ b/src/queries/all-open-prs-query.ts @@ -10,6 +10,7 @@ query GetAllOpenPRsAndCardIDs($after: String) { edges { cursor node { + isDraft number updatedAt projectCards(first: 100) { nodes { id } } @@ -38,7 +39,7 @@ export async function getAllOpenPRsAndCardIDs() { if (!edge) continue; const { node, cursor } = edge; after = cursor; - if (!node) continue; + if (!node || node.isDraft) continue; prNumbers.push(node.number); node.projectCards.nodes?.forEach(n => n && cardIDs.push(n.id)); diff --git a/src/queries/schema/GetAllOpenPRsAndCardIDs.ts b/src/queries/schema/GetAllOpenPRsAndCardIDs.ts index f31cc455b..2090d310a 100644 --- a/src/queries/schema/GetAllOpenPRsAndCardIDs.ts +++ b/src/queries/schema/GetAllOpenPRsAndCardIDs.ts @@ -22,6 +22,10 @@ export interface GetAllOpenPRsAndCardIDs_repository_pullRequests_edges_node_proj export interface GetAllOpenPRsAndCardIDs_repository_pullRequests_edges_node { __typename: "PullRequest"; + /** + * Identifies if the pull request is a draft. + */ + isDraft: boolean; /** * Identifies the pull request number. */