Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e86864d

Browse filesBrowse files
authored
Merge pull request actions#117 from robyoung/fix-pull-request-test-for-forks
Fix PR test workflow for forks
2 parents b251c3e + 58e7e1d commit e86864d
Copy full SHA for e86864d

File tree

1 file changed

+17
-17
lines changed
Filter options

1 file changed

+17
-17
lines changed

‎.github/workflows/pull-request-test.yml

Copy file name to clipboardExpand all lines: .github/workflows/pull-request-test.yml
+17-17Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ jobs:
2020
issue_number: context.payload.number,
2121
})
2222
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');
3425
} 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+
}
4141
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.