Hey @chrisworman-pela,
Is this a protected branch? If so, you may have to remove the check on the GitHub side. Even though these instructions are for enabling instead of disabling status checks, they will take you to the right place in GitHub where you should be able to remove netlify/pelacase/deploy-preview:
Maybe this helps someone Instead of unlinking my Github repo (i.e. asking about that in my comment above), I ended up just doing:
// netlify.toml
[build]
ignore = "/bin/true"
And calling a webhook from CI.
This isn’t ideal because although all automatic builds are cancelled (triggered as a result of a merge to master, in my case)…
We can no longer manually deploy from the Netlify Site UI
the build log is still cluttered w/ “cancelled” builds
it’s also a misleading workaround which is unintuitive for my fellow engineers to follow and/or duplicate in other projects.
This leads me to really want a clean way to configure “Active Builds” without automatically building&deploying. I’m sure something like this is in the works, but wanted to just post this for posterity and the Netlify team’s visibility…
Hi, @bhagaban. The workflow being repeated in this topic is unlinking repositories from sites. For this workflow, we need the site API id, not the API key.
There are no sites with the API id you listed. You can find the API id under “Site Name” > Settings > General > Site information.
If you send us that id, we can unlink the repo. Note, this can also be done using the API. The Netlify CLI tool makes calling the API easier and it can be done like so:
netlify api unlinkSiteRepo --data '{ "site_id": "1a997e22-11b7-44b7-945b-c062ef03c8bf" }'
You would need to replace 1a997e22-11b7-44b7-945b-c062ef03c8bf in the command above with the actual API id as found under “Site Name” > Settings > General > Site information. If you use Netlify CLI you can unlink the repo without the support team’s assistance.
If you would prefer for us to unlink the repo, again, please let us know the API id (not the key) and we will unlink it.
Hello Netlify folks - this is something I’d also like, but there’s got to be a better way than this round about method of manually unlinking. Surely it would be simple to have the GUI set to “stop builds”, and still allow a specific webhook / API call to trigger. Eg a query param ?force_build=true (from Build hooks | Netlify Docs).
Hello, somehow this flew a bit under the radar but we released the functionality to self-unlink via the UI in late February of this year. You can now take care of things yourself via this URL:
https://app.netlify.com/sites/[YOUR SITE NAME]/settings/deploys under manage repository:
Hello, I stumbled upon this thread as I was trying to block automatic deploys to both my production and staging branches until CI passes but I don’t want to block Deploy Previews.
My approach was similar to option 2, stop auto publishing and triggering a deploy with either a hook or the CLI from my CI pipeline but both seem to fail because of the lock; using the CI give a prompt to unlock deployments but I’m unable to respond to it in a CI context.
Any suggestions on how this could be accomplished?
I tried that approach but to lock/un-lock deploys via de API, I needed to either save the previous deploy id or find it every time since the endpoint requests it.
We ended up disabling builds completely and building on the CI to then deploy with the CLI with a mix of --prod and --alias flags based on the different cases
Is there any way of knowing if a deploy originated from a build hook from inside the ignore builds script?
With Vercel we have the deployment.meta.deployHookId which is very useful to short-circuit their Github App for preview environments deployment and take control over when to deploy when using Github Actions, but still benefitting from the Github App (comments in PR, deployment status in Github…).
This is a bit of a kludge but there is an environment variable which only exists when a webhook is used to trigger a deploy. The environment variable is named INCOMING_HOOK_BODY.
Even if no body is sent, the variable will be created for all webhook triggered deploys. If no webhook is used, the variable won’t be defined at all.
Yeah this could work, as far as I understand that endpoint, it returns a list of all the deploys but again I have to find in all of them the one that my site is “locked” too. Is there a way to filter the query to get just that one deploy id?