FIX: Use only first line from commit message (#18724)

Linking a commit from a GitHub pull request included the complete commit
message, instead of just the first line. The rest of the commit message
will be added to the body of the Onebox.
This commit is contained in:
Bianca Nenciu
2022-10-24 22:26:48 +03:00
committed by GitHub
parent f4c70283f7
commit 266e165885
3 changed files with 5 additions and 3 deletions

View File

@ -40,7 +40,7 @@ module Onebox
result['body'], result['excerpt'] = compute_body(result['body'])
if result['commit'] = load_commit(link)
result['body'], result['excerpt'] = compute_body(result['commit']['body'])
result['body'], result['excerpt'] = compute_body(result['commit']['commit']['message'].lines[1..].join)
elsif result['comment'] = load_comment(link)
result['body'], result['excerpt'] = compute_body(result['comment']['body'])
elsif result['discussion'] = load_review(link)