From 7cf88abeb0c83c7f22dc566949d22395f4a294e7 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 6 Sep 2023 11:48:47 -0400 Subject: [PATCH] chore: add error when no new diffs generated --- .../actions/update-reference-screenshots/action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/update-reference-screenshots/action.yml b/.github/workflows/actions/update-reference-screenshots/action.yml index 493678f22ae..47f37373259 100644 --- a/.github/workflows/actions/update-reference-screenshots/action.yml +++ b/.github/workflows/actions/update-reference-screenshots/action.yml @@ -35,7 +35,16 @@ runs: git config user.name ionitron git config user.email hi@ionicframework.com git add src/\*.png --force - git commit -m "chore(): add updated snapshots" - git push + + if git diff --exit-code; then + echo -e "\033[1;31m⚠️ Error: No new screenshots generated ⚠️\033[0m" + echo -e "\033[1;31mThis means that there were zero visual diffs when running screenshot tests.\033[0m" + echo -e "\033[1;31mMake sure you have pushed any code changes that would result in visual diffs.\033[0m" + exit 1 + else + git commit -m "chore(): add updated snapshots" + git push + fi + shell: bash working-directory: ./core