根据bitbucket服务器参考https://docs.atlassian.com/bitbucket-server/javadoc/5.3.0/spi/reference/com/atlassian/bitbucket/hook/repository/PreRepositoryHook.html
在功能中
public RepositoryHookResult preUpdate(PreRepositoryHookContext context, RepositoryHookRequest request)
我如何获得当前用户,或者谁在推送代码?不是提交人的作者。
您需要传递给钩子AuthenticationContext
对象并使用getCurrentUser()
方法