File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,21 @@ build:
14
14
os : ubuntu-22.04
15
15
tools :
16
16
python : " 3.10"
17
+ jobs :
18
+ post_checkout :
19
+ # https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
20
+ #
21
+ # Cancel building pull requests when there aren't changed in the docs directory.
22
+ # `--quiet` exits with a 1 when there **are** changes,
23
+ # so we invert the logic with a !
24
+ #
25
+ # If there are no changes (exit 0) we force the command to return with 183.
26
+ # This is a special exit code on Read the Docs that will cancel the build immediately.
27
+ - |
28
+ if [ $READTHEDOCS_VERSION_TYPE = "external" ];
29
+ then
30
+ ! git diff --quiet origin/main -- docs/ && exit 183;
31
+ fi
17
32
18
33
search :
19
34
ranking :
You can’t perform that action at this time.
0 commit comments