From 843d0c132c0f95dfee50eaaf667a92fffe400eeb Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Mon, 11 Sep 2023 13:29:33 +0300
Subject: [PATCH v2 2/2] Skip CI if changes are only in docs or in the READMEs

When changes are only in docs or in the READMEs, skip all the tasks.

This skip is overriden in 'SanityCheck' and 'Build the Docs' tasks. So,
these two tasks might have not been skipped.
---
 .cirrus.tasks.yml | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index d7c45224af9..ec6bcd5af70 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -3,6 +3,11 @@
 # For instructions on how to enable the CI integration in a repository and
 # further details, see src/tools/ci/README
 
+# When changes are only in docs or in the READMEs, skip all the tasks.
+#
+# This skip is overriden in 'SanityCheck' and 'Build the Docs' tasks. So,
+# these two tasks might have not been skipped.
+skip: changesIncludeOnly('doc/**', '**/README')
 
 env:
   # The lower depth accelerates git clone. Use a bit of depth so that
@@ -54,12 +59,12 @@ on_failure_meson: &on_failure_meson
 # broken commits, have a minimal task that all others depend on.
 task:
   name: SanityCheck
-
-  # If a specific OS is requested, don't run the sanity check. This shortens
+  # If a specific OS is requested or if there are changes only in the docs
+  # or in the READMEs, don't run the sanity check. This shortens
   # push-wait-for-ci cycle time a bit when debugging operating system specific
   # failures. Uses skip instead of only_if, as cirrus otherwise warns about
   # only_if conditions not matching.
-  skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
+  skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*' || changesIncludeOnly('doc/**', '**/README')
 
   env:
     CPUS: 4
-- 
2.40.1

