git - How to create a GitLab hook to reject code pushed by 'root' user? -


I work with a disciplined team and one of the developers likes to push code as 'root' user . We need to add a gitlab hook which rejects the incoming 'root' user

I have read and neither feels like the right direction.

Can any of you gitlab master help me?

You need to create a server side pre-fetch hook Will investigate. You can do this with a script like: s <$ p>

  refname = "$ 1" oldrev = "$ 2" newrev = "$ 3" $ $ (git rev-list $ { oldrev} .. $ {newrev}) git log $ {sha} --format = "% ae% ce" -1 Grep 'root @' if [$? -Ece 0] then echo "Root $ {sha}" to a root email address. Please use your user credentials! "Git log $ {sha} - format ="% ae% ce "-1 exit 1fi:   

or you can call it a ruby Create a version, to browse using your API

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -