Skip to content

Commit

Permalink
Add check for empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjitse-E committed Mar 22, 2024
1 parent 991564c commit c7721d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37621,6 +37621,10 @@ async function run() {
}
const pullRequest = await (0, github_api_1.getPullRequestById)(token, owner, repo, parseInt(prNumber));
let body = pullRequest.body;
if (body === null) {
core.info('Pull request body is empty');
return;
}
// Remove for double quotes at the start or end of body
body = body.replace(/(^"|"$)/g, '');
core.info(`Searching through pull request body for changelog section:`);
Expand Down
4 changes: 4 additions & 0 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default async function run(): Promise<void> {

const pullRequest = await getPullRequestById(token, owner, repo, parseInt(prNumber))
let body = pullRequest.body
if (body === null) {
core.info('Pull request body is empty')
return
}

// Remove for double quotes at the start or end of body
body = body.replace(/(^"|"$)/g, '');
Expand Down

0 comments on commit c7721d6

Please sign in to comment.