Browse Source

Add check for forked PRs in update-api workflow

pull/20733/merge
Max Katz 6 months ago
committed by GitHub
parent
commit
4218e0ea7d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      .github/workflows/update-api.yml

4
.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;
}

Loading…
Cancel
Save