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 2929
3030 const mdFiles = prFiles.data.filter(file => file.filename.endsWith('.md')).map(file => file.filename);
3131
32- if(! mdFiles){
32+ if(mdFiles.length === 0 ){
3333 github.rest.issues.createComment({
3434 issue_number: context.issue.number,
3535 owner: context.repo.owner,
@@ -43,10 +43,13 @@ jobs:
4343 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}`);
4444
4545 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({
4748 issue_number: context.issue.number,
4849 owner: context.repo.owner,
4950 repo: context.repo.repo,
5051 body: `${commentBody}`
51- });
52+ });
53+ }
54+
5255
You can’t perform that action at this time.
0 commit comments