File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 1- name : Comment on Active " Add Profile" Issues
1+ name : Comment on Active Add Profile Issues
22
33on :
44 workflow_dispatch :
55 schedule :
6- - cron : ' 0 */3 * * *'
6+ - cron : ' 0 */6 * * *'
77
88jobs :
99 comment-on-active-issues :
@@ -27,13 +27,27 @@ jobs:
2727 const issueCreator = issue.user.login;
2828 const commentMessage = `@all-contributors please add @${issueCreator} for review`;
2929
30- await github.rest.issues.createComment ({
30+ const { data: comments } = await github.rest.issues.listComments ({
3131 owner: context.repo.owner,
3232 repo: context.repo.repo,
33- issue_number: issue.number,
34- body: commentMessage
33+ issue_number: issue.number
3534 });
3635
37- console.log(`Commented on issue #${issue.number}`);
36+ const hasAllContributorsComment = comments.some(comment =>
37+ comment.body.includes('@all-contributors please add')
38+ );
39+
40+ if (!hasAllContributorsComment) {
41+ await github.rest.issues.createComment({
42+ owner: context.repo.owner,
43+ repo: context.repo.repo,
44+ issue_number: issue.number,
45+ body: commentMessage
46+ });
47+
48+ console.log(`Commented on issue #${issue.number}`);
49+ } else {
50+ console.log(`Skipped commenting on issue #${issue.number} - already has an all-contributors comment`);
51+ }
3852 }
3953 }
You can’t perform that action at this time.
0 commit comments