@@ -20,22 +20,22 @@ jobs:
20
20
issue_number: context.payload.number,
21
21
})
22
22
23
- // Find any comment already made by the bot.
24
- const botComment = comments.find(comment => comment.user.id === 41898282)
25
- const commentBody = "Hello from actions/github-script! (${{ github.sha }})"
26
-
27
- if (botComment) {
28
- await github.issues.updateComment({
29
- owner: context.repo.owner,
30
- repo: context.repo.repo,
31
- comment_id: botComment.id,
32
- body: commentBody
33
- })
23
+ if (context.payload.pull_request.head.repo.full_name !== 'actions/github-script') {
24
+ console.log('Not attempting to write comment on PR from fork');
34
25
} else {
35
- await github.issues.createComment({
36
- owner: context.repo.owner,
37
- repo: context.repo.repo,
38
- issue_number: context.payload.number,
39
- body: commentBody
40
- })
26
+ if (botComment) {
27
+ await github.issues.updateComment({
28
+ owner: context.repo.owner,
29
+ repo: context.repo.repo,
30
+ comment_id: botComment.id,
31
+ body: commentBody
32
+ })
33
+ } else {
34
+ await github.issues.createComment({
35
+ owner: context.repo.owner,
36
+ repo: context.repo.repo,
37
+ issue_number: context.payload.number,
38
+ body: commentBody
39
+ })
40
+ }
41
41
}
0 commit comments