mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Merge pull request #117 from robyoung/fix-pull-request-test-for-forks
Fix PR test workflow for forks
This commit is contained in:
34
.github/workflows/pull-request-test.yml
vendored
34
.github/workflows/pull-request-test.yml
vendored
@@ -20,22 +20,22 @@ jobs:
|
|||||||
issue_number: context.payload.number,
|
issue_number: context.payload.number,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Find any comment already made by the bot.
|
if (context.payload.pull_request.head.repo.full_name !== 'actions/github-script') {
|
||||||
const botComment = comments.find(comment => comment.user.id === 41898282)
|
console.log('Not attempting to write comment on PR from fork');
|
||||||
const commentBody = "Hello from actions/github-script! (${{ github.sha }})"
|
|
||||||
|
|
||||||
if (botComment) {
|
|
||||||
await github.issues.updateComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: botComment.id,
|
|
||||||
body: commentBody
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
await github.issues.createComment({
|
if (botComment) {
|
||||||
owner: context.repo.owner,
|
await github.issues.updateComment({
|
||||||
repo: context.repo.repo,
|
owner: context.repo.owner,
|
||||||
issue_number: context.payload.number,
|
repo: context.repo.repo,
|
||||||
body: commentBody
|
comment_id: botComment.id,
|
||||||
})
|
body: commentBody
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
await github.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.payload.number,
|
||||||
|
body: commentBody
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user