Is there any other approach for tagging git branch using pipeline without credentials in pipeline code?
I believe that what you need is just a Personal Access Token, or if you're a maintainer, possibly a Deploy Token. It's much safer than embedding user credentials.