Skip to content

Commit 7d0f873

Browse files
authored
fix: handles pull request iterator when graphQL returns no files (#1544)
* test: failing test for when graphql returns no files * fix: handles pull request iterator when graphQL returns no files * chore: fix lint
1 parent e9386e5 commit 7d0f873

4 files changed

Lines changed: 1250 additions & 2 deletions

File tree

__snapshots__/github.js

Lines changed: 370 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,10 @@ export class GitHub {
648648
number: pullRequest.number,
649649
baseBranchName: pullRequest.baseRefName,
650650
headBranchName: pullRequest.headRefName,
651-
labels: (pullRequest.labels.nodes || []).map(l => l.name),
651+
labels: (pullRequest.labels?.nodes || []).map(l => l.name),
652652
title: pullRequest.title,
653653
body: pullRequest.body + '',
654-
files: pullRequest.files.nodes.map(node => node.path),
654+
files: (pullRequest.files?.nodes || []).map(node => node.path),
655655
};
656656
}),
657657
};

0 commit comments

Comments
 (0)