Skip to content

Commit

Permalink
[#223] Change implementation of Ignoring Danger run on WIP pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
mosharaf13 committed Jul 5, 2023
1 parent 85d2ce6 commit 9a74913
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,8 +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
if github.pr_labels.include?('wip') || github.pr_title.include?('[WIP]') || github.pr_json['draft']
message('Skipping Danger run: Pull request is marked as work-in-progress or draft.')
has_wip_label = github.pr_labels.any? { |label| label.include? 'wip' }
has_wip_title = github.pr_title.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
end

Expand Down

0 comments on commit 9a74913

Please sign in to comment.