gitlab 15.6 added hooks and a pre_get_sources_script hook that can be executed before the git clone.
hooks
pre_get_sources_script