From 82f59829b81061ab86e02e68234131e1ad613847 Mon Sep 17 00:00:00 2001 From: Matthias Wild <40327258+mauwii@users.noreply.github.com> Date: Sun, 18 Dec 2022 21:54:07 +0100 Subject: [PATCH] set workflow PR triggers to filter PR-types (#2065) * set workflow PR triggers to filter PR-types - `review_requested` - `ready_for_review` * fail tests if draft pr * add more types to test pr triggers * remove unneeded condition * readd condition * leave PR-types default, only verify PRs to main and fail for draft-PRs * set types to cancel when converted to draft --- .github/workflows/test-invoke-conda.yml | 15 +++++++++++++-- .github/workflows/test-invoke-pip.yml | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 6560cb4930..fd6caf47fe 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -3,18 +3,29 @@ on: push: branches: - 'main' - - 'development' pull_request: branches: - 'main' - - 'development' + types: + - 'ready_for_review' + - 'opened' + - 'synchronize' + - 'converted_to_draft' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: + fail_if_pull_request_is_draft: + if: github.event.pull_request.draft == true + runs-on: ubuntu-22.04 + steps: + - name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass. + run: exit 1 + matrix: + if: github.event.pull_request.draft == false strategy: matrix: stable-diffusion-model: diff --git a/.github/workflows/test-invoke-pip.yml b/.github/workflows/test-invoke-pip.yml index 5d6a7b4bbe..b12a7ca879 100644 --- a/.github/workflows/test-invoke-pip.yml +++ b/.github/workflows/test-invoke-pip.yml @@ -3,18 +3,28 @@ on: push: branches: - 'main' - - 'development' pull_request: branches: - 'main' - - 'development' + types: + - 'ready_for_review' + - 'opened' + - 'synchronize' + - 'converted_to_draft' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: + fail_if_pull_request_is_draft: + if: github.event.pull_request.draft == true + runs-on: ubuntu-18.04 + steps: + - name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass. + run: exit 1 matrix: + if: github.event.pull_request.draft == false strategy: matrix: stable-diffusion-model: