Backport "Pass relevant git environment variables while calling `/allowed`" to 3-6-stable See merge request !120