How to know about current git branch in preset

I’ve had a shell script for local builds that I was hoping to sunset in favour of a CmakeUserPresets.json and it works very well with the exception that this script sets the output dir based on the name of the current git branch (eg _build-my-branch).
Is there a good way to accomplish this with presets alone or would I need to do something like a wrapper around the cmake call putting this in an env variable perhaps?

You would need a wrapper and env var with the preset