File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,11 +24,16 @@ jobs:
2424 const author = pr.user.login;
2525 const assoc = pr.author_association;
2626
27+ // Is PR branch in the same repo (not a fork)?
28+ const sameRepo =
29+ pr.head.repo != null && pr.head.repo.id === pr.base.repo.id;
30+
2731 const botAllowlist = new Set(['dependabot[bot]']);
2832 const orgAuthorAssociations = new Set(['MEMBER', 'OWNER']);
2933
3034 const allowed =
3135 botAllowlist.has(author) ||
36+ sameRepo ||
3237 (assoc != null && orgAuthorAssociations.has(assoc));
3338
3439 if (!allowed) {
4853
4954 core.setFailed('Dependency changes are restricted to organization members.');
5055 } else {
51- console.log(`Author ${author} (author_association=${assoc}) is allowed to make dependency changes.`);
56+ console.log(`Author ${author} (author_association=${assoc}, sameRepo=${sameRepo} ) is allowed to make dependency changes.`);
5257 }
You can’t perform that action at this time.
0 commit comments