Unfortunately the things that get cloned during a bitbucket pipeline are owned by root. Even if you set the run-as-user directive this is still the case. The only thing that changes when setting this directive is that the cached directories are owned by the defined user.
This is a problem on our use case, because we start a container within this container, where the user is not root. And we share the volume with this container, so we have a permission problem there.