From bf34d46487ab45606c4d674bf0c4daf91899c4ea Mon Sep 17 00:00:00 2001 From: eric sciple Date: Fri, 24 Jan 2020 16:39:37 -0500 Subject: [PATCH] . --- .github/workflows/workflow.yml | 4 ++++ __tests__/verify-no-unstaged-changes.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 __tests__/verify-no-unstaged-changes.sh 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