Hook for publishing master branch

I’ve started using deployment build hooks, both for master and preview merge requests.

My problem is, that I had to disable auto publishing because master would then deploy even if tests fail (that’s why I had to move to build hooks, coulnd’t manage to fail gitlab pipeline otherwise), because of the integration between netlify and gitlab.

So I’m looking for a way to do some kind of publish hook / use api(?). I also might be wrong about disabling auto publishing, please guide me a little bit here.

You can manage your deployment process more effectively by using a combination of features:

  1. Stop Auto Publishing: If you want to prevent automatic deployment of your master branch even if tests fail, you can stop auto publishing. This will allow you to control when your site is published. You can stop auto publishing by navigating to your site’s deploy list and selecting “Lock to stop auto publishing”. When you’re ready to publish, you can select “Unlock to start auto publishing”
    Manage deploys | Netlify Docs
  2. Use Webhooks for CI/CD Automation: You can use outgoing webhooks to trigger specific actions in external systems, such as your CI/CD pipeline. This can help automate your end-to-end deployment workflows
    Streamlining your development workflow: a guide to CI/CD automation using webhooks
  3. Deploy Notifications: You can set up notifications for various deploy events such as when a deploy starts, succeeds, fails, or is locked/unlocked. This can help you keep track of your deployment process Deploy notifications | Netlify Docs
  4. Skip Deploys: If you want to push commits to a branch without triggering a deploy on Netlify, you can add [skip ci] or [skip netlify] to your Git commit message or the title of your pull/merge request

Depending on your specific needs and workflow, you may need to use a combination of these features.