From 2a35692255251c28b364e345c29e439d3ac65ade Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 6 Nov 2026 02:08:57 +0000 Subject: [PATCH] ci: skip every job on draft pull requests Draft pull_request runs no longer execute docs validation, tests, or Firebase previews. Marking a PR ready fires ready_for_review and runs CI. Push and workflow_call behavior is unchanged. Co-authored-by: Leo Farias --- .github/workflows/docs.yml | 4 ++++ .github/workflows/firebase-hosting-pull-request.yml | 5 ++++- .github/workflows/test.yml | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 76bf69b0..026f3b8c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,9 @@ on: - "docs/**" - "docs.json" - ".github/workflows/docs.yml" + # Draft pull requests skip every job. ready_for_review runs CI when the PR is marked ready. pull_request: + types: [opened, synchronize, reopened, ready_for_review] branches: ["main"] paths: - "docs/**" @@ -20,6 +22,8 @@ concurrency: jobs: validate: + # `draft` is null on push, so non-pull_request runs are unchanged. + if: ${{ github.event.pull_request.draft != true }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 596c236f..9b728b33 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -4,7 +4,9 @@ name: Deploy to Firebase Hosting on PR on: + # Draft pull requests skip every job. ready_for_review runs CI when the PR is marked ready. pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - "demo/**" - "packages/**" @@ -19,7 +21,8 @@ permissions: jobs: build_and_preview: - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + # Same-repository previews only. Draft pull requests skip this job. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.draft != true }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c93b82d3..d4069cc4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,9 @@ on: workflow_call: push: branches: [main] + # Draft pull requests skip every job. ready_for_review runs CI when the PR is marked ready. pull_request: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: test-${{ github.ref }} @@ -12,6 +14,8 @@ concurrency: jobs: test: + # `draft` is null on push and on workflow_call from push, so those runs are unchanged. + if: ${{ github.event.pull_request.draft != true }} runs-on: ubuntu-latest name: Test timeout-minutes: 12 @@ -67,6 +71,7 @@ jobs: fvm flutter test test/goldens/pdf_export_dialog_golden_test.dart integration-test: + if: ${{ github.event.pull_request.draft != true }} runs-on: ubuntu-latest name: Integration Tests timeout-minutes: 25 @@ -127,6 +132,7 @@ jobs: timeout-minutes: 7 web-smoke: + if: ${{ github.event.pull_request.draft != true }} runs-on: ubuntu-latest name: Web Smoke (Playwright) timeout-minutes: 25