From 4c056aaee3dab783affdf52e7f2dc8393b7690ad Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 5 Sep 2026 07:23:32 +0900 Subject: [PATCH] ci(actions): skip draft pull request jobs Signed-off-by: Seongho Bae --- .github/workflows/ci.yml | 4 ++++ .../tests/test_workflow_concurrency_contract.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 963d058..84e52aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: [main] pull_request: + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] # Cancel superseded evidence for the same pull request or branch. This keeps the # runner queue bounded during review-fix loops while preserving the newest head. @@ -17,6 +18,7 @@ permissions: jobs: account-unification-tests: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest defaults: run: @@ -49,6 +51,7 @@ jobs: run: uv build --out-dir dist realm-config-validates: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -68,6 +71,7 @@ jobs: PY compose-config-validates: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/services/account_unification/tests/test_workflow_concurrency_contract.py b/services/account_unification/tests/test_workflow_concurrency_contract.py index eafc6ca..116062f 100644 --- a/services/account_unification/tests/test_workflow_concurrency_contract.py +++ b/services/account_unification/tests/test_workflow_concurrency_contract.py @@ -18,5 +18,19 @@ def test_ci_cancels_only_superseded_heads_from_the_same_pull_request() -> None: assert "cancel-in-progress: ${{ github.event_name == 'pull_request' }}" in workflow +def test_ci_skips_draft_and_closed_pull_requests() -> None: + workflow = (WORKFLOWS / "ci.yml").read_text(encoding="utf-8") + + assert ( + "types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]" + in workflow + ) + admission = ( + "if: ${{ github.event_name != 'pull_request' || " + "(github.event.action != 'closed' && github.event.pull_request.draft == false) }}" + ) + assert workflow.count(admission) == 3 + + def test_central_codeql_is_not_duplicated_locally() -> None: assert not (WORKFLOWS / "codeql.yml").exists()