From d57cfc1d3a4a77beb4b093983ad64fa41ddcc0e3 Mon Sep 17 00:00:00 2001 From: Md Mosharaf Hossan Date: Fri, 7 Jul 2023 17:25:38 +0700 Subject: [PATCH] [#223] Shift danger skip condition from Dangerfile to github test workflow --- .template/addons/github/.github/workflows/test.yml.tt | 2 +- Dangerfile | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.template/addons/github/.github/workflows/test.yml.tt b/.template/addons/github/.github/workflows/test.yml.tt index 99ed67b53..84e462d49 100644 --- a/.template/addons/github/.github/workflows/test.yml.tt +++ b/.template/addons/github/.github/workflows/test.yml.tt @@ -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: diff --git a/Dangerfile b/Dangerfile index 00d81c011..25c565b23 100644 --- a/Dangerfile +++ b/Dangerfile @@ -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)