From 035258f9252f45b50599e845bcfbf76ab7363495 Mon Sep 17 00:00:00 2001 From: Yao Chi Date: Wed, 30 Oct 2024 16:37:39 +0800 Subject: [PATCH] Run CI only when PR is not in draft status (#194) * add sr deprecated message * run ci test when status is not draft --- .github/workflows/workflow-ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index ad3dd480..53951111 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + types: [opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} @@ -42,13 +43,24 @@ jobs: run-examples-workflows: needs: check-modified-files - if: ${{ needs.check-modified-files.outputs.only_non_code_files == 'false' }} + if: ${{ needs.check-modified-files.outputs.only_non_code_files == 'false' && github.event.pull_request.draft == false }} runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-latest] steps: + - name: Check if PR is draft + id: check_draft + run: | + if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ "$GITHUB_EVENT_PULL_REQUEST_DRAFT" = "true" ]; then + echo "PR is draft, skipping CI" + echo "::set-output name=skip::true" + else + echo "PR is not draft, running CI" + echo "::set-output name=skip::false" + fi + - name: Show Base run: | echo "Current directory: $(pwd)"