mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
CLA: Handle commits with no author information
This commit is contained in:
parent
d8a2095400
commit
624934b05b
1 changed files with 6 additions and 4 deletions
10
.github/workflows/check-cla.yml
vendored
10
.github/workflows/check-cla.yml
vendored
|
|
@ -10,7 +10,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
def jsonRequest(url, data={}):
|
def jsonRequest(url, data={}):
|
||||||
req = urllib.request.Request(url,
|
req = urllib.request.Request(url,
|
||||||
|
|
@ -19,9 +18,12 @@ jobs:
|
||||||
with urllib.request.urlopen(req) as response:
|
with urllib.request.urlopen(req) as response:
|
||||||
return json.loads(response.read().decode('utf-8'))
|
return json.loads(response.read().decode('utf-8'))
|
||||||
prCommits = jsonRequest('https://api.github.com/repos/juce-framework/JUCE/pulls/${{ github.event.number }}/commits')
|
prCommits = jsonRequest('https://api.github.com/repos/juce-framework/JUCE/pulls/${{ github.event.number }}/commits')
|
||||||
authors = map(lambda commit: [commit['author']['login'], commit['committer']['login']], prCommits)
|
allAuthors = [commit[authorType]['login'] for authorType in ['author', 'committer'] for commit in prCommits if commit[authorType]]
|
||||||
uniqueAuthors = [name for name in list(set(itertools.chain.from_iterable(authors))) if name != 'web-flow']
|
uniqueAuthors = [name for name in list(set(allAuthors)) if name != 'web-flow']
|
||||||
print(f'\nPR authors: {", ".join(uniqueAuthors)}')
|
if (len(uniqueAuthors) == 0):
|
||||||
|
print(f'\nNo author or committer user IDs contained within commit information\n\n{prCommits}\n')
|
||||||
|
sys.exit(1)
|
||||||
|
print(f'Authors: {uniqueAuthors}')
|
||||||
claResult = jsonRequest('https://cla.juce.com/check', {'logins': uniqueAuthors})
|
claResult = jsonRequest('https://cla.juce.com/check', {'logins': uniqueAuthors})
|
||||||
unsignedLogins = claResult['unsigned']
|
unsignedLogins = claResult['unsigned']
|
||||||
if (len(unsignedLogins) != 0):
|
if (len(unsignedLogins) != 0):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue