]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip CI expensive checks on `CODEOWNERS` update (#128754)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 14 Jan 2025 08:40:59 +0000 (09:40 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2025 08:40:59 +0000 (10:40 +0200)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
.github/workflows/reusable-change-detection.yml

index 964bd87e815f425a64d62eefc97b3ebc712d54db..c08c0cb8873f125a058afa9dc1cee61a736c00ec 100644 (file)
@@ -83,7 +83,22 @@ jobs:
           # into the PR branch anyway.
           #
           # https://github.com/python/core-workflow/issues/373
-          git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
+          grep_ignore_args=(
+            # file extensions
+              -e '\.md$'
+              -e '\.rst$'
+            # top-level folders
+              -e '^Doc/'
+              -e '^Misc/'
+            # configuration files
+              -e '^\.github/CODEOWNERS$'
+              -e '^\.pre-commit-config\.yaml$'
+              -e '\.ruff\.toml$'
+              -e 'mypy\.ini$'
+          )
+          git diff --name-only "origin/$GITHUB_BASE_REF.."        \
+            | grep -qvE "${grep_ignore_args[@]}"                  \
+            && echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
         fi
 
         # Check if we should run hypothesis tests