gh-action-bump-version/node_modules/actions-toolkit/lib/get-body.js

20 lines
623 B
JavaScript
Raw Normal View History

2021-08-07 21:20:18 +00:00
"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