From: David Galloway Date: Mon, 22 Aug 2022 20:29:01 +0000 (-0400) Subject: admin: Fix check if PR or release branch docs build X-Git-Tag: v18.0.0~199^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f92133ca527b5608b7ba8b79396568b03fa686b3;p=ceph.git admin: Fix check if PR or release branch docs build Uses built-in RTD vars. https://docs.readthedocs.io/en/stable/environment-variables.html. Follow up to https://github.com/ceph/ceph/pull/46917#discussion_r942359130. Signed-off-by: David Galloway --- diff --git a/admin/rtd-checkout-main b/admin/rtd-checkout-main index 931816dce9ed..829d7c384699 100755 --- a/admin/rtd-checkout-main +++ b/admin/rtd-checkout-main @@ -1,6 +1,10 @@ # See .readthedocs.yml set -ex -if git symbolic-ref HEAD; then +re='^[0-9]+$' +if [[ $READTHEDOCS_VERSION =~ $re ]]; then + echo "Building docs for PR $READTHEDOCS_VERSION. Will not check out doc/releases from main branch." +else + echo "Building docs for $READTHEDOCS_VERSION branch. Will check out doc/releases from main branch." git checkout origin/main -- doc/releases fi git status