Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 70de356

Browse files
committed
Extend author trust
1 parent a288e2e commit 70de356

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tools/ci/pr_preview.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
# The number of seconds to wait between attempts to verify that a deployment
3131
# has occurred
3232
POLLING_PERIOD = 5
33+
# Pull requests from authors with the following associations to the project
34+
# should automatically receive previews
35+
#
36+
# https://developer.github.com/v4/enum/commentauthorassociation/
37+
TRUSTED_AUTHOR_ASSOCIATIONS = ('COLLABORATOR', 'MEMBER', 'OWNER')
3338

3439
logging.basicConfig(level=logging.INFO)
3540
logger = logging.getLogger(__name__)
@@ -237,17 +242,8 @@ def has_label(pull_request):
237242
return False
238243

239244
def should_be_mirrored(pull_request):
240-
print '''
241-
is_open(pull_request): {}
242-
pull_request['author_association']: {}
243-
has_label(pull_request): {}
244-
'''.format(
245-
is_open(pull_request),
246-
pull_request['author_association'],
247-
has_label(pull_request)
248-
)
249245
return is_open(pull_request) and (
250-
pull_request['author_association'] == 'COLLABORATOR' or
246+
pull_request['author_association'] in TRUSTED_AUTHOR_ASSOCIATIONS or
251247
has_label(pull_request)
252248
)
253249

0 commit comments

Comments
 (0)