Skip to content

Commit

Permalink
Merge pull request #326 from Yegorov/325
Browse files Browse the repository at this point in the history
#325: fix empty author id
  • Loading branch information
yegor256 authored Sep 4, 2024
2 parents d1d7d29 + 25fb970 commit 9763dab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion judges/github-events/github-events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def self.fetch_contributors(fact, repo)
contributors = Set.new
if last
Fbe.octo.compare(repo, last.tag, fact.tag)[:commits].each do |commit|
contributors << commit[:author][:id]
author_id = commit.dig(:author, :id)
contributors << author_id if author_id
end
else
Fbe.octo.contributors(repo).each do |contributor|
Expand Down
5 changes: 4 additions & 1 deletion test/judges/test-github-events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,10 @@ def test_release_event_contributors
{ sha: 'a50489ead5e8aa6', author: { login: 'Yegorov', id: 2_566_462 } },
{ sha: 'b50489ead5e8aa7', author: { login: 'Yegorov64', id: 2_566_463 } },
{ sha: 'c50489ead5e8aa8', author: { login: 'Yegorov128', id: 2_566_464 } },
{ sha: 'd50489ead5e8aa9', author: { login: 'Yegorov', id: 2_566_462 } }
{ sha: 'd50489ead5e8aa9', author: { login: 'Yegorov', id: 2_566_462 } },
{ sha: 'e50489ead5e8aa9', author: nil },
{ sha: 'e60489ead5e8aa9' },
{ sha: 'e70489ead5e8aa9', author: { login: 'NoUser' } }
],
files: [
{ additions: 15, deletions: 40, changes: 55 },
Expand Down

0 comments on commit 9763dab

Please sign in to comment.