You are right, I had the same issue and I need to update the article, nice catch 🤓
I still don’t fully understand why that happens, but the way I solved is by adding
git add . to the script.
So the final script will be:
echo "Running spotless check"
git add .