Hook into events system

Hi. I’m trying to understand Ghost. I’d like to create a plugin which overrides event behavior relating to post submissions. Any post which is published or edited should omit actually publishing, and instead run the code in the plugin.

The goal is to have a submission instance of ghost that triggers a pipeline in GitLab. The post is pushed to a review branch and viewed in a dynamic environment (review app) If it is approved by reviewers, then the submission commits to master branch and goes live on a production instance of Ghost.

I didn’t quite see this functionality in the docs. I did see that these types of events were available to attach a webhook. That won’t override the default behavior. It’s a lot cleaner to override the actual post until approved through the pipeline, pushing to submission and production instances simultaneously. That helps keep the state in sync.

Is this doable with a ghost plugin?

https://ghost.org/docs/webhooks/

The page I’m referencing regarding webooks.