Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(github): harden commit checks
  • Loading branch information
rarkins committed Jul 9, 2020
1 parent 9fe82cc commit ce8ce88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/platform/github/index.ts
Expand Up @@ -663,7 +663,8 @@ async function getOpenPrs(): Promise<PrList> {
if (pr.commits.nodes.length === 1) {
if (global.gitAuthor) {
// Check against gitAuthor
const commitAuthorEmail = pr.commits.nodes[0].commit.author.email;
const commitAuthorEmail =
pr.commits?.nodes?.[0]?.commit?.author?.email;
if (commitAuthorEmail === global.gitAuthor.email) {
pr.isModified = false;
} else {
Expand Down Expand Up @@ -700,9 +701,8 @@ async function getOpenPrs(): Promise<PrList> {
} else {
const baseCommitSHA = await getBaseCommitSHA();
if (
pr.commits.nodes[0].commit.parents.edges.length &&
pr.commits.nodes[0].commit.parents.edges[0].node.oid !==
baseCommitSHA
pr.commits?.nodes[0]?.commit?.parents?.edges?.[0]?.node?.oid !==
baseCommitSHA
) {
pr.isStale = true;
}
Expand Down

0 comments on commit ce8ce88

Please sign in to comment.