Skip to content

Commit

Permalink
Add Dangerfile improvements from PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Feb 13, 2024
1 parent 530c0cf commit 49f63b4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android_release_checker.check_release_notes_and_play_store_strings

android_strings_checker.check_strings_do_not_refer_resource

# skip remaining checks if we're during the release process
# skip remaining checks if we're in a release-process PR
if github.pr_labels.include?('Releases')
message('This PR has the `Releases` label: some checks will be skipped.')
return
Expand All @@ -30,14 +30,17 @@ pr_size_checker.check_diff_size(

android_unit_test_checker.check_missing_tests

# skip remaining checks if we have a Draft PR
return if github.pr_draft?
# skip remaining checks if the PR is still a Draft
if github.pr_draft?
message('This PR is still a Draft: some checks will be skipped.')
return
end

labels_checker.check(
do_not_merge_labels: ['Do Not Merge'],
required_labels: [//],
required_labels_error: 'PR requires at least one label.'
)

# skip check for draft PRs and for WIP features unless the PR is against the main branch or release branch
milestone_checker.check_milestone_due_date(days_before_due: 4) unless github_utils.wip_feature? && !(github_utils.release_branch? || github_utils.main_branch?)
# runs the milestone check if this is not a WIP feature and the PR is against the main branch or the release branch
milestone_checker.check_milestone_due_date(days_before_due: 4) if (github_utils.main_branch? || github_utils.release_branch?) && !github_utils.wip_feature?

0 comments on commit 49f63b4

Please sign in to comment.