You've already forked element-x-android
mirror of
https://github.com/element-hq/element-x-android.git
synced 2026-10-29 22:29:00 +03:00
recordScreenshots.sh runs under `set -e`, and the `git commit -m "Update screenshots"` at the end of it is unconditional. When a recording run produces no diff — the common case once the snapshots are already up to date — `git commit` exits 1 with "nothing to commit, working tree clean" and takes the whole workflow down with it, reporting a red job for a successful run. Stage as before, then return early when the staged diff is empty. `set -e` is left in place: it was added deliberately so that a failed Gradle run cannot push a commit that deletes every snapshot. Using `git diff --cached --quiet` as an `if` condition is `set -e`-safe, because its non-zero "there are changes" status is consumed by the condition. The early return also skips the push, which had nothing to send.