We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d0e287 commit 6e2286aCopy full SHA for 6e2286a
index.js
@@ -122,7 +122,14 @@ function pathListToMarkdown(files) {
122
}
123
124
function getPayloadBody() {
125
- const body = context.payload.comment ? context.payload.comment.body : context.payload.review.body
+ let body = context.payload.comment ? context.payload.comment.body : context.payload.review.body
126
+ /**
127
+ * Of the three ways to review code ("commented", "approved", "changes_requested"), only
128
+ * "approved" can have a "null" body. For that case, ignore instead of throw error.
129
+ */
130
+ if (context.payload?.review?.state === 'approved' && body === null) {
131
+ body = ''
132
+ }
133
if (body == null) {
134
throw new Error(`No body found, ${JSON.stringify(context)}`)
135
0 commit comments