From 2b754af627a1d4d93fdbf28c79eab64db5ea72cd Mon Sep 17 00:00:00 2001 From: Piotr Leniec Date: Tue, 22 Dec 2020 09:49:21 +0100 Subject: [PATCH] [DW-31] Add a condition that prohibits checks to be run on draft PRs Unfortunately, github actions doesn't support using "if" property in defaults and that's why we need to repeat it for all jobs --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15dc0049e7a6ce6117f0206e518678871b103045..40e180a7e5cc91eccec97915a5073af2fe5a66e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,17 @@ name: CI -on: [pull_request] +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review jobs: check_commit_messages: name: check commit messages + if: github.event.pull_request.draft == false runs-on: self-hosted steps: - name: clone repository @@ -14,12 +21,14 @@ jobs: - name: check commit messages run: ./tools/check_commit_messages.py build: + if: github.event.pull_request.draft == false runs-on: self-hosted steps: - name: build run: echo "Placeholder for old CI scripts" check_copyright_and_style: name: check copyright and style + if: github.event.pull_request.draft == false runs-on: self-hosted steps: - name: clone repository @@ -35,6 +44,7 @@ jobs: build_rt1051_binary: name: build rt1051 binary + if: github.event.pull_request.draft == false needs: - check_copyright_and_style runs-on: self-hosted @@ -56,6 +66,7 @@ jobs: build_linux_binary_and_run_tests: name: build linux binary and run tests + if: github.event.pull_request.draft == false needs: - check_copyright_and_style runs-on: self-hosted