diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f8bff896..d13390ed 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,6 +31,10 @@ jobs: - name: npm test run: npm test + - name: Verify no unstaged changes + if: runner.os != 'windows' + run: __test__/verify-no-unstaged-changes.sh + test: name: Test E2E runs-on: ubuntu-latest diff --git a/__tests__/verify-no-unstaged-changes.sh b/__tests__/verify-no-unstaged-changes.sh new file mode 100755 index 00000000..9fe6173a --- /dev/null +++ b/__tests__/verify-no-unstaged-changes.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && npm ci && npm run all" + exit 1 +fi