From f92133ca527b5608b7ba8b79396568b03fa686b3 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Mon, 22 Aug 2022 16:29:01 -0400 Subject: [PATCH] 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 --- admin/rtd-checkout-main | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/rtd-checkout-main b/admin/rtd-checkout-main index 931816dce9ed5..829d7c3846991 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 -- 2.39.5