Hi @discorev, I’m sorry, this one took longer than I thought.
This env var is only supplied if an ignored build step is set in the projects git settings. Otherwise, it will not be set. A workaround is to add
"ignoreCommand": "exit 1"
To your vercel.json. This should allow for the variable to then be defined for you in your script. An ignoreCommand that always exits 1 tells Vercel “don’t skip, always build”, which ensures your vercel.sh script runs on every commit and all the git-related env vars are recomputed each time. From there you can diff the current SHA against whatever you persist as the last convex deploy SHA in your script.
Can you add that line and let me know if it works?
If it solves your issue, I’ll update the docs.