diff --git a/.github/workflows/cooker-selfhosted-persistent.yml b/.github/workflows/cooker-selfhosted-persistent.yml
index b2403330..14f28fbf 100644
--- a/.github/workflows/cooker-selfhosted-persistent.yml
+++ b/.github/workflows/cooker-selfhosted-persistent.yml
@@ -122,7 +122,7 @@ jobs:
       # if the branch is coming from a PR the tag should be manually built
       - name: "Generate version tag"
         run: |
-          if [[ "$BRANCH_NAME" == 'ref/'* ]]; then
+          if [[ "$BRANCH_NAME" == 'refs/'* ]]; then
             pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}')
             original_branch=$(git ls-remote --heads origin "refs/pull/$pr_number/head" | cut -d'/' -f3)
             echo "TAG=PR-$pr_number-$original_branch-${{ env.buildid }}" >> $GITHUB_ENV