Skip to content

Commit

Permalink
Improve code for no reviewers check
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Oct 26, 2023
1 parent 447edca commit 4ee84bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ def wip_feature?
has_wip_label || has_wip_title
end

def finished_reviews?
repo_name = github.pr_json['base']['repo']['full_name']
pr_number = github.pr_json['number']

!github.api.pull_request_reviews(repo_name, pr_number).empty?
end

def requested_reviewers?
!github.pr_json['requested_teams'].to_a.empty? || !github.pr_json['requested_reviewers'].to_a.empty?
has_requested_reviews = !github.pr_json['requested_teams'].to_a.empty? || !github.pr_json['requested_reviewers'].to_a.empty?
has_requested_reviews || finished_reviews?
end

return if github.pr_labels.include?('Releases')
Expand Down

0 comments on commit 4ee84bf

Please sign in to comment.