Skip to content

Commit

Permalink
[#223] Have danger run skip on PR with case insensitive conditions o…
Browse files Browse the repository at this point in the history
…n title and label
  • Loading branch information
mosharaf13 committed Jul 6, 2023
1 parent 9a74913 commit 7e57cc5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# frozen_string_literal: true

# Skip Danger run if the opened pull request has "wip" label, [WIP] in the title, or status is Draft
has_wip_label = github.pr_labels.any? { |label| label.include? 'wip' }
has_wip_title = github.pr_title.include? '[WIP]'
has_wip_label = github.pr_labels.any? { |label| label.downcase.include? 'wip' }
has_wip_title = github.pr_title.downcase.include? '[wip]'
is_draft = github.pr_draft?

if has_wip_label || has_wip_title || is_draft
message('Skipping Danger since PR is classed as Work in Progress')
return
return message('Skipping Danger since PR is classed as Work in Progress')
end

# Runs Rubocop and submit comments on modified and added files
Expand Down

0 comments on commit 7e57cc5

Please sign in to comment.