Skip to content

Commit

Permalink
fix: head commit not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
maximousblk authored Mar 3, 2021
1 parent a75fc58 commit 02e1492
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,16 @@ export async function getCommits(
});
}

const _base = {
sha: data.base_commit.sha,
url: data.base_commit.html_url,
message: data.base_commit.commit.message,
author: getCommitAuthor(data.base_commit),
};

return {
base: {
sha: data.base_commit.sha,
url: data.base_commit.html_url,
message: data.base_commit.commit.message,
author: getCommitAuthor(data.base_commit),
},
head: commits[commits.length - 1],
base: _base,
head: commits[commits.length - 1] ?? _base,
commits,
};
}
Expand Down

0 comments on commit 02e1492

Please sign in to comment.