Browse Source
Add check for forked PRs in update-api workflow
pull/20733/merge
Max Katz
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
1 deletions
-
.github/workflows/update-api.yml
|
|
|
@ -59,7 +59,9 @@ jobs: |
|
|
|
repo: context.repo.repo, |
|
|
|
pull_number: context.issue.number, |
|
|
|
}); |
|
|
|
if (pr.head.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`) { |
|
|
|
const isFork = pr.head.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`; |
|
|
|
const isTrustedOverride = context.payload.comment.body.includes('/trusted'); |
|
|
|
if (isFork && !isTrustedOverride) { |
|
|
|
core.setFailed('Cannot run /update-api on fork PRs — would execute untrusted code with write permissions.'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|