Hi,
My website uses the renovate
github bot to bump dependencies, and as such it creates a lot of PRs on the repo. In an effort to save build minutes, I’d like to skip building + creating deployment previews for these PRs, opting to rely on my other github checks and only deploy when merged to master.
To achieve this, I’m trying to use the ignore
option described here: How to Ignore Builds - Optimize your Netlify Build Times and here: File-based configuration | Netlify Docs. My netlify.toml config in its entirety looks like this:
[context.deploy-preview]
ignore = "git log -1 --format='%aN' | grep -i renovate"
Note that I don’t want to set ignore
globally for [build]
, hence the [context.deploy-preview]
, since my understanding is that it’d then ignore builds from Renovate even on master, which I don’t want (since I still want my website to deploy for real if any commit is merged to master, including Renovate’s).
I verified that locally running git log -1 --format='%aN' | grep -i renovate
when the last commit was from Renovate returns 0, which in my understanding would no-op the build (ignoring it). However, if I look at a recent deploy preview such as this one: Netlify App, I can see the line Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git log -1 --format='%aN' | grep -i renovate'
, but the build continues on.
This makes me think that the toml file is correct and recognised, but that something’s wrong with my ignore command. Based on the blogpost and docs I had assumed it would be run on the branch making the change, so git log -1
(as used in the blog post for a similar usecase - dependabot) would return the most recent PR’s Renovate commit, and grepping case-insenstively against the commit’s author would return 0. But I assume I’ve made some kind of mistake here so any pointers would be much appreciated.
I should also mention that I tried searching the forum before writing this and found some similar posts, but those seemed from 2020 and were related to not being on the Xenial build image, which I appear to be.
Thanks in advance!