Restarting the previous discussion because I missed the chance to reply before it closed: Cancel preview build for a branch when a new build is started
From previous post:
Our team uses Vercel Preview in our CI pipeline as a smoke test before merging code into main to make sure that the code builds successfully. The current issue for our team is that devs frequently publish a new PR, realize they need to make additional changes, and then push new changes into the PR shortly after. This triggers 2 preview build processes for the same PR
However, with the way we use our preview as a smoke test, we only need the latest build to succeed since any previous builds don’t reflect the current state of the PR. We do realize that devs can manually cancel previous builds, but this doesn’t easily scale with team size as it requires consistent human behavior/habits/reinforcement
Does Vercel offer any simple way to automatically cancel previous builds for a branch when a new build is triggered on that same branch?
The current reply was that “Vercel automatically cancels previous builds when a new commit is pushed to the same Pull Request branch.” However, this doesn’t seem to be our experienced behavior. I’ve attached a screenshot from a video I took of this behavior. It seems all new commits on a feature branch wait for the previous commit to finish building before starting.