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:

#!/bin/bash
echo "Running spotless check"
./gradlew spotlessApply
git add .

Senior Android Engineer @WeTransfer 🤖 🇻🇪🇮🇹 Paraglider, Runner, Kayaker.

Love podcasts or audiobooks? Learn on the go with our new app.