this is why I think taking the parameter might be useful, or maybe an external file to source with the branch name in it?

e.g. in the top of this script ./as-branch-name.sh (name tbd) which just has:
export AS_BRANCH=5_BRANCH or 4_BRANCH depending on the branch we are on

Or just ask the user to give it as a paramter and if [ $? -ne 1 ]; then bork