Skip to content

Commit 2adfaf1

Browse files
committed
Remove redundant logic
1 parent 0202bec commit 2adfaf1

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

.github/workflows/guard-dependencies.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,12 @@ jobs:
2222
script: |
2323
const pr = context.payload.pull_request;
2424
const author = pr.user.login;
25-
const assoc = pr.author_association;
2625
2726
// Is PR branch in the same repo (not a fork)?
2827
const sameRepo =
2928
pr.head.repo != null && pr.head.repo.id === pr.base.repo.id;
3029
31-
const botAllowlist = new Set(['dependabot[bot]']);
32-
const orgAuthorAssociations = new Set(['MEMBER', 'OWNER']);
33-
34-
const allowed =
35-
botAllowlist.has(author) ||
36-
sameRepo ||
37-
(assoc != null && orgAuthorAssociations.has(assoc));
38-
39-
if (!allowed) {
30+
if (!sameRepo) {
4031
await github.rest.issues.createComment({
4132
owner: context.repo.owner,
4233
repo: context.repo.repo,
@@ -53,5 +44,5 @@ jobs:
5344
5445
core.setFailed('Dependency changes are restricted to organization members.');
5546
} else {
56-
console.log(`Author ${author} (author_association=${assoc}, sameRepo=${sameRepo}) is allowed to make dependency changes.`);
47+
console.log(`Author ${author} (sameRepo=${sameRepo}) is allowed to make dependency changes.`);
5748
}

0 commit comments

Comments
 (0)