Skip to content

Commit 8f274ad

Browse files
committed
Fix release_log to support commits without 'author' meta field
1 parent d6ba11b commit 8f274ad

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/release_log.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def main():
2727
for commit in data['commits']:
2828
message = commit['commit']['message']
2929
first_line = message.partition('\n\n')[0]
30-
gh_username = commit['author']['login']
30+
if commit.get('author'):
31+
username = '@{}'.format(commit['author']['login'])
32+
else:
33+
username = commit['commit']['author']['name']
3134
sha = commit["sha"][:8]
3235

3336
m = re.search(r'\#(?P<num>\d+)\b', message)
@@ -37,7 +40,7 @@ def main():
3740
issue_num = None
3841

3942
print(f'* {first_line}')
40-
print(f' (by @{gh_username} in {sha}', end='')
43+
print(f' (by {username} in {sha}', end='')
4144
if issue_num:
4245
print(f' for #{issue_num})')
4346
else:

0 commit comments

Comments
 (0)