diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 3271328..dfe3265 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -192,7 +192,7 @@ for branch in "$ypdocsbranch" dunfell $(git branch --remote --contains "$first_s
     fi
     # Do not build contrib/ branches as they are development branches only
     # Do build request branch though!
-    if echo "$branch" | grep -v "$ypdocsbranch" | grep -q -E "^contrib/"; then
+    if echo "$branch" | grep -v "^$ypdocsbranch$" | grep -q -E "^contrib/"; then
         continue
     fi
 
