This is the future way to go as the plan is to replace the hooks with events. This also seems to be a cleaner way of doing it.
Should remove the .gitlab-ci.yml file added in this MR before merging and instead merge in [#3433065]