File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 29
29
30
30
const mdFiles = prFiles.data.filter(file => file.filename.endsWith('.md')).map(file => file.filename);
31
31
32
- if(! mdFiles){
32
+ if(mdFiles.length === 0 ){
33
33
github.rest.issues.createComment({
34
34
issue_number: context.issue.number,
35
35
owner: context.repo.owner,
@@ -43,10 +43,13 @@ jobs:
43
43
const urls = mdFiles.map(file => `${basePath}https://raw.githubusercontent.com/${context.repo.owner}/${context.repo.repo}/refs/heads/${context.payload.pull_request.head.ref}/${file}`);
44
44
45
45
const commentBody = urls.map(url => `URL to preview article: ${url}`).join("\n\n");
46
- github.rest.issues.createComment({
46
+ if(commentBody.trim().length > 0){
47
+ github.rest.issues.createComment({
47
48
issue_number: context.issue.number,
48
49
owner: context.repo.owner,
49
50
repo: context.repo.repo,
50
51
body: `${commentBody}`
51
- });
52
+ });
53
+ }
54
+
52
55
You can’t perform that action at this time.
0 commit comments