You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skip CI Tests Based on Checks, Not Action File #8971
Is your feature request related to a problem? Please describe.
An attempt was made to avoid running tests when only documentation was changed by adding patterns to paths-ignore in the actions files. This has the effect of making checks not run which blocks PRs, the hope was instead that these would show up as successfully ignored but it's not to be.
The alternative is to conditions the steps of jobs within actions on a check against changes. My idea is to use checking code in one job to detect if there's code change in Python files or changes in any other non-documentation file, then condition steps on that result. This would cause documentation only changes to not trigger tests, so changes to documentation files are ignored, and Python changes affecting only docstrings or comments are ignored.
This uses a Python script to parse source files and compare them at the AST level, while also ignoring documentation files. Any other file changes trigger tests just in case. This uses the standard library so no dependencies exist other than Python.
The first job uses this script inside a bash loop going through every changed file. The output is then used by subsequent jobs to skip the test steps if no changes are found, so the job runs successfully even if nothing is done.
Describe alternatives you've considered
Using paths-ignore won't work in conjunction with require job passes for PRs to be mergeable. There isn't another actions mechanism to do this it seems.
Comments never reach the AST (compare_sources.py#L32-L33), so deleting a # type: ignore or # noqa would count as docs-only and skip lint/mypy. Maybe we should always run the static-checks?
Comments never reach the AST (compare_sources.py#L32-L33), so deleting a # type: ignore or # noqa would count as docs-only and skip lint/mypy. Maybe we should always run the static-checks?
Activity
aymuos15 commentedon Jul 2, 2026
Comments never reach the AST (
compare_sources.py#L32-L33), so deleting a# type: ignoreor# noqawould count as docs-only and skip lint/mypy. Maybe we should always run the static-checks?ericspod commentedon Jul 2, 2026
Agreed, static checks with pyrefly (if we choose: #8868) would be run always.
aymuos15 commentedon Jul 3, 2026
Yeah that sounds good. Pyrefly should be pretty fast too.
8971 Skip Tests On Docs Only (Project-MONAI#9109)