Ensure DEPLOY_BRANCH is set before checking it

Check if isset($DEPLOY_BRANCH) before checking if it is a valid branch.