20 lines
623 B
JavaScript
20 lines
623 B
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
/**
|
||
|
* Get the body of the relevant comment, review, issue or pull request
|
||
|
* @param payload - Webhook payload
|
||
|
*/
|
||
|
function getBody(payload) {
|
||
|
if (payload.comment)
|
||
|
return payload.comment.body;
|
||
|
if (payload.review)
|
||
|
return payload.review.body;
|
||
|
// If neither of those comments are present, check the body
|
||
|
if (payload.issue)
|
||
|
return payload.issue.body;
|
||
|
if (payload.pull_request)
|
||
|
return payload.pull_request.body;
|
||
|
return undefined;
|
||
|
}
|
||
|
exports.getBody = getBody;
|
||
|
//# sourceMappingURL=get-body.js.map
|