Fix logic for discovering new branches
[releng/global-jjb.git] / shell / rtdv3.sh
index 7b4fef8..f5be6e6 100644 (file)
@@ -130,8 +130,8 @@ echo "INFO: Performing merge action"
     branch=$(echo "$GERRIT_BRANCH" | tr '[:upper:]' '[:lower:]')
     echo "INFO: Checking if read the docs has seen branch $branch"
 
-    #if this is 404. then run discover branch
-    if ! lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active'; then
+    #if this is 200 "null" Then run discover branch
+    if [[ $(lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active') == "null" ]]; then
       echo "INFO: read the docs has not seen branch $branch for project $rtdproject"
       echo "INFO: triggering $rtdproject latest to instantiate new branch discovery"
       watchbuild latest