Skip to content

Commit

Permalink
[#223] Shift danger skip condition from Dangerfile to github test wor…
Browse files Browse the repository at this point in the history
…kflow
  • Loading branch information
mosharaf13 committed Jul 7, 2023
1 parent 506bcda commit d57cfc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion .template/addons/github/.github/workflows/test.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
needs: unit_tests
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && !contains(join(github.event.pull_request.labels.*.name, ','), 'wip') && !contains(github.event.pull_request.title, '[wip]') && !github.event.pull_request.draft
steps:
- uses: actions/checkout@v3
with:
Expand Down
10 changes: 0 additions & 10 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# 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.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
end

# Runs Rubocop and submit comments on modified and added files
rubocop.lint(inline_comment: true, force_exclusion: true)

Expand Down

0 comments on commit d57cfc1

Please sign in to comment.