Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
permissions:
pull-requests: read
outputs:
full_ci: ${{ github.event_name != 'pull_request' || (!startsWith(github.event.pull_request.title, 'docs') && steps.filter.outputs.full_ci == 'true') }}
full_ci: ${{ github.event_name != 'pull_request' || steps.filter.outputs.full_ci == 'true' }}
steps:
- name: Detect non-documentation changes
id: filter
if: github.event_name == 'pull_request' && !startsWith(github.event.pull_request.title, 'docs')
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@v4
with:
predicate-quantifier: every
Expand Down
23 changes: 23 additions & 0 deletions tests/test_ci_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Regression checks for the primary CI workflow."""

from pathlib import Path
from typing import Any

import yaml


def test_full_ci_depends_on_changed_paths_not_pr_title() -> None:
"""Ensure a docs-prefixed title cannot bypass substantive CI jobs."""
workflow_path = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "ci.yml"
workflow: dict[str, Any] = yaml.load(workflow_path.read_text(), Loader=yaml.BaseLoader)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
changes = workflow["jobs"]["changes"]

full_ci = changes["outputs"]["full_ci"]
assert "pull_request.title" not in full_ci

filter_step = next(step for step in changes["steps"] if step.get("id") == "filter")
assert "pull_request.title" not in filter_step["if"]
assert filter_step["if"] == "github.event_name == 'pull_request'"