Context
We have a repo, hosted on a local gitlab instance.
It contains a ressource file, which should be valid. The validity is checked by a given script.
What I want
I want to ensure that, whenever the master
branch is updated on the gitlab
repo, the file at the new head of master
passes the validation script.
Possibilities explored
all updates to
master
should go through a Merge Request- I haven't found a way to enable / disable the
Merge
button based on the result of a script, - I could upload a script in the bare
hooks/
directory of the baregit
repo managed by gitlab, but I don't know of apre-merge
hook in git
- I haven't found a way to enable / disable the
updates to master can be pushed by developpers
- I know how to write and upload an
update
hook, which validates the master branch on the bare git repo,
I don't know how to prevent other ways to update themaster
branch
- I know how to write and upload an
Question
Using gitlab
and git
, how can I make sure that updates to the master
branch only allow hops to validated versions of the file ?