diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 274ad20..5f5fa05 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -243,7 +243,7 @@ for branch in "$ypdocsbranch" dunfell $(git branch --remote --contains "$first_s
     )
 
     # Strip yocto- from tag names
-    branch=$(echo "$branch" | sed 's/yocto-//')
+    branch=${branch//yocto-/}
 
     if [ "$branch" = "master-next" ]; then
         branch="next"
