Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI only when PR is not in draft status #194

Merged
merged 10 commits into from
Oct 30, 2024
14 changes: 13 additions & 1 deletion .github/workflows/workflow-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -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)"
Expand Down
Loading