Custom Hook doesn't find environment variable
Summary
I use a pre-receive hook in a few of my GitLab projects. My pre-receive hook reads a few environment variables. The environment variables can be read if I edit a file from the gitlab web interface, but the variables can't be read if I push git references from my local repository.
Steps to reproduce
- Create a GitLab project
- Go to the project directory on the file system in
repositories/[namespace]/[projectname].git
- Add a directory namend
custom_hooks
and go into the directory - Add a
pre-receive
hook file and read an environment variable, print it and exit the hook with status 1. - Work on a commit with the web editor and see that the environment variable will be printed.
- Work on a commit locally, push it and see that the environemnt variable won't be printed.
Oh mabye create a new environment variable first
Example Project
Don't have it, sorry
What is the current bug behavior?
The environment can only be read from gitlabs web editor.
What is the expected correct behavior?
The environemnt variable can also be read if you push something from your local repository.
Edited by 🤖 GitLab Bot 🤖