Skip to content

Commit 308dd65

Browse files
committed
test
1 parent 8bf1660 commit 308dd65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/comment-on-pr.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
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

0 commit comments

Comments
 (0)