Skip to content

Commit a79eeaf

Browse files
authored
Merge pull request #767 from github/fix-check-for-spammy-action
Fix null title/body case
2 parents 93ce01d + f562c61 commit a79eeaf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/check-for-spammy-issues.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ jobs:
2222
const owner = 'github'
2323
const repo = 'rest-api-description'
2424
25-
const titleWordCount = issue.title.trim().split(' ').length
25+
let titleWordCount = 0
26+
if (issue.title) {
27+
titleWordCount = issue.title.trim().split(' ').length
28+
}
2629
const titleWordCountMin = 3
2730
28-
const bodyWordCount = issue.body.trim().split(' ').length
31+
let bodyWordCount = 0
32+
if (issue.body) {
33+
bodyWordCount = issue.body.trim().split(' ').length
34+
}
2935
const bodyWordCountMin = 6
3036
3137
try {

0 commit comments

Comments
 (0)