diff --git a/.readthedocs.yml b/.readthedocs.yml index 59830c79a404e0..8c4b662f8a9542 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -20,7 +20,7 @@ build: # If there are no changes (git diff exits with 0) we force the command to return with 183. # This is a special exit code on Read the Docs that will cancel the build immediately. - | - if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && [ "$(git diff --quiet origin/main -- Doc/ .readthedocs.yml; echo $?)" -eq 0 ]; + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && [ "$(git diff --quiet $(git merge-base HEAD origin/main) -- Doc/ .readthedocs.yml; echo $?)" -eq 0 ]; then echo "No changes to Doc/ - exiting the build."; exit 183;