Skip to content

Commit

Permalink
Merge master into greenkeeper/@types/debug-0.0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
probot-auto-merge[bot] committed Oct 4, 2018
2 parents 374d4c5 + ddfbc89 commit 45680e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pull-request-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ export async function queryPullRequest (github: Context['github'], { owner, repo
if (!response) {
throw new Error(`Could not query pull request ${owner}/${repo}#${pullRequestNumber}`)
}
if (!response.repository) {
const error: any = new Error(`Query result does not have repository`)
if (!response.repository || !response.repository.pullRequest || !response.repository.pullRequest.headRef) {
const error: any = new Error(`Query result is not complete`)
error.pullRequest = `${owner}/${repo}#${pullRequestNumber}`
error.response = response
throw error
}

const queryResult = response as PullRequestQueryResult

const checks = result<{ check_runs: CheckRun[] }>(await github.checks.listForRef({
Expand Down

0 comments on commit 45680e0

Please sign in to comment.