I’m trying to reduce build minutes by eliminating deploy previews for Renovate PR branches. I’ve added the following to all my netlify.toml files:
[build]
# Ignore Renovate PRs
# @see https://www.netlify.com/blog/2020/04/27/ignore-unnecessary-builds-to-optimize-your-build-times/
ignore = "git log -1 --pretty=%B | grep bot@renovateapp.com"
However, even with that, I still see preview deploy builds for every Renovate PR:
hillary
September 14, 2021, 7:11pm
2
Hey there, @Scott_Vandehey
Thanks for reaching out, and welcome to the Netlify Forums! Good question. I think this thread will help you find a workaround:
We’ve recently started using renovate for automated package updates, and have deploy previews on for all PR’s (which we’ve started to love and now heavily lean on in our review process). Most of our Netlify build time is now used up by renovate branches/pull requests and we’d like to have more control over which branches are eligible for deploy previews.
Is it possible to deploy only certain branch names using an include/exclude pattern so we can fine-tune which branches/PR’s will get a deploy …
Give that a read and let me know if it gets you on the right track!
Thank you!
That thread, unless I’m missing something, ultimately recommends the use of the ignore
property in the Netlify config file, which is what I’m doing, and it’s not working?
Based on this thread it sounds like the ignore
option only works with a script.
I’m now trying to exclude the builds by adding the following to my renovate config:
"commitBody": "[skip netlify]"
Hi @Scott_Vandehey ,
I do believe ignore
would help you get the job done, but you should check for the git log
to see if the script is actually returning an exit code of 0.
But yes, instead of that, using [skip netlify]
is a better option as it’s way easier.