From 704d629bf5d4be3c03b8b0585d284e850684b889 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 13 Sep 2023 10:48:38 -0400 Subject: [PATCH 1/2] chore(ci): account for new screenshots in error logging --- .../workflows/actions/update-reference-screenshots/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/update-reference-screenshots/action.yml b/.github/workflows/actions/update-reference-screenshots/action.yml index 47f37373259..b38964279ff 100644 --- a/.github/workflows/actions/update-reference-screenshots/action.yml +++ b/.github/workflows/actions/update-reference-screenshots/action.yml @@ -34,7 +34,7 @@ runs: run: | git config user.name ionitron git config user.email hi@ionicframework.com - git add src/\*.png --force + git add src/\*.png --force -N if git diff --exit-code; then echo -e "\033[1;31m⚠️ Error: No new screenshots generated ⚠️\033[0m" From d4d459e3bc7312a05df4f6f25d218d626557bfad Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 13 Sep 2023 10:58:16 -0400 Subject: [PATCH 2/2] add the actual file --- .../actions/update-reference-screenshots/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/actions/update-reference-screenshots/action.yml b/.github/workflows/actions/update-reference-screenshots/action.yml index b38964279ff..52ac254169f 100644 --- a/.github/workflows/actions/update-reference-screenshots/action.yml +++ b/.github/workflows/actions/update-reference-screenshots/action.yml @@ -34,6 +34,10 @@ runs: run: | git config user.name ionitron git config user.email hi@ionicframework.com + + # This adds an empty entry for new + # screenshot files so we can track them with + # git diff git add src/\*.png --force -N if git diff --exit-code; then @@ -42,6 +46,9 @@ runs: echo -e "\033[1;31mMake sure you have pushed any code changes that would result in visual diffs.\033[0m" exit 1 else + # This actually adds the contents + # of the screenshots (including new ones) + git add src/\*.png --force git commit -m "chore(): add updated snapshots" git push fi