From 9bbfdd40eb2ebf59039d1bcce036f51555e52b0b Mon Sep 17 00:00:00 2001 From: Ahmad Sattar Date: Tue, 9 Nov 2021 18:14:08 +0100 Subject: [PATCH] Support deleted PR branch --- src/PullRequests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PullRequests.ts b/src/PullRequests.ts index 59c4b1d..78eb5a2 100644 --- a/src/PullRequests.ts +++ b/src/PullRequests.ts @@ -3,7 +3,7 @@ import { context, getOctokit } from "@actions/github"; interface PullRequestDetailsResponse { repository: { pullRequest: { - headRef: { + headRef?: { name: string; target: { oid: string; @@ -70,7 +70,7 @@ export async function pullRequestDetails(token: string) { return { base_ref: baseRef.name, base_sha: baseRef.target.oid, - head_ref: headRef.name, - head_sha: headRef.target.oid, + head_ref: headRef?.name, + head_sha: headRef?.target.oid, }; }