You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
body: 'Your comment was flagged as too short and will be automatically deleted. Please elaborate further on your thoughts, I want to hear what you have to say!'
45
44
});
46
45
47
-
// Close issue
48
-
await github.rest.issues.update({
49
-
owner: context.repo.owner,
50
-
repo: context.repo.repo,
51
-
issue_number: context.issue.number,
52
-
state: 'closed',
53
-
state_reason: 'not_planned'
54
-
});
55
-
56
-
// Delete issue
57
-
await github.rest.issues.deleteIssue({
58
-
owner: context.repo.owner,
59
-
repo: context.repo.repo,
60
-
issue_number: context.issue.number
61
-
});
46
+
// Delete the short comment if it's a reply comment
47
+
if (commentId) {
48
+
await github.rest.issues.deleteComment({
49
+
owner: context.repo.owner,
50
+
repo: context.repo.repo,
51
+
comment_id: commentId
52
+
});
53
+
} else {
54
+
// If it's the issue body, close the issue
55
+
await github.rest.issues.update({
56
+
owner: context.repo.owner,
57
+
repo: context.repo.repo,
58
+
issue_number: context.issue.number,
59
+
state: 'closed',
60
+
state_reason: 'not_planned'
61
+
});
62
+
}
62
63
63
-
console.log(`Deleted issue #${context.issue.number} - too short (${charCount} characters)`);
64
+
console.log(`Deleted comment - too short (${charCount} characters)`);
0 commit comments