From d82eb7349924f6a2a32b05435086a91a0c767796 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Thu, 7 Sep 2023 17:10:45 +0300
Subject: [PATCH v1 2/2] Just run the Build the Docs task if the changes are
 only in docs

If the changes are only in the docs, skip all tasks except 'Build the
Docs' task.
---
 .cirrus.tasks.yml | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 21e276beb3b..4ccf75cefda 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, skip all tasks except
+# 'Build the Docs' task.
+#
+# This skip is overriden in 'SanityCheck' and 'Build the Docs' task.
+skip: changesIncludeOnly('doc/**')
 
 env:
   # The lower depth accelerates git clone. Use a bit of depth so that
@@ -54,12 +59,11 @@ 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
-  # 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:.*'
+  # If a specific OS is requested or if there are changes only in the docs,
+  # 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:.*' || changesIncludeOnly('doc/**')
 
   env:
     CPUS: 4
-- 
2.40.1

