File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 10
10
run : |
11
11
import urllib.request
12
12
import json
13
- import itertools
14
13
import sys
15
14
def jsonRequest(url, data={}):
16
15
req = urllib.request.Request(url,
19
18
with urllib.request.urlopen(req) as response:
20
19
return json.loads(response.read().decode('utf-8'))
21
20
prCommits = jsonRequest('https://api.github.com/repos/juce-framework/JUCE/pulls/${{ github.event.number }}/commits')
22
- authors = map(lambda commit: [commit['author']['login'], commit['committer']['login']], prCommits)
23
- uniqueAuthors = [name for name in list(set(itertools.chain.from_iterable(authors))) if name != 'web-flow']
24
- print(f'\nPR authors: {", ".join(uniqueAuthors)}')
21
+ allAuthors = [commit[authorType]['login'] for authorType in ['author', 'committer'] for commit in prCommits if commit[authorType]]
22
+ uniqueAuthors = [name for name in list(set(allAuthors)) if name != 'web-flow']
23
+ if (len(uniqueAuthors) == 0):
24
+ print(f'\nNo author or committer user IDs contained within commit information\n\n{prCommits}\n')
25
+ sys.exit(1)
26
+ print(f'Authors: {uniqueAuthors}')
25
27
claResult = jsonRequest('https://cla.juce.com/check', {'logins': uniqueAuthors})
26
28
unsignedLogins = claResult['unsigned']
27
29
if (len(unsignedLogins) != 0):
You can’t perform that action at this time.
0 commit comments