diff --git a/dist/index.js b/dist/index.js index 70bd00ddc..9b604f939 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1560,7 +1560,9 @@ function run() { if (isPullRequest) { const pullRequest = yield githubHelper.getPull(github.context.repo, github.context.payload.issue.number); // Truncate the body to keep the size of the payload under the max - pullRequest.body = pullRequest.body.slice(0, 1000); + if (pullRequest.body) { + pullRequest.body = pullRequest.body.slice(0, 1000); + } clientPayload['pull_request'] = pullRequest; } // Dispatch for each matching configuration diff --git a/src/main.ts b/src/main.ts index 313c6d4ce..d8dc6a918 100644 --- a/src/main.ts +++ b/src/main.ts @@ -164,7 +164,9 @@ async function run(): Promise { github.context.payload.issue.number ) // Truncate the body to keep the size of the payload under the max - pullRequest.body = pullRequest.body.slice(0, 1000) + if (pullRequest.body) { + pullRequest.body = pullRequest.body.slice(0, 1000) + } clientPayload['pull_request'] = pullRequest }