diff --git a/.github/workflows/actions/update-reference-screenshots/action.yml b/.github/workflows/actions/update-reference-screenshots/action.yml index 47f3737325..52ac254169 100644 --- a/.github/workflows/actions/update-reference-screenshots/action.yml +++ b/.github/workflows/actions/update-reference-screenshots/action.yml @@ -34,7 +34,11 @@ runs: run: | git config user.name ionitron git config user.email hi@ionicframework.com - git add src/\*.png --force + + # 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 echo -e "\033[1;31m⚠️ Error: No new screenshots generated ⚠️\033[0m" @@ -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