diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18bf064feccf..c1e17ef67840 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,9 @@ jobs: env: BABEL_8_BREAKING: false STRIP_BABEL_8_FLAG: true + - name: Ensure cwd does not contain uncommitted changes + run: | + ./scripts/assert-dir-git-clean.sh - uses: actions/upload-artifact@v2 with: name: babel-artifact diff --git a/scripts/assert-dir-git-clean.sh b/scripts/assert-dir-git-clean.sh new file mode 100755 index 000000000000..de07b02483dd --- /dev/null +++ b/scripts/assert-dir-git-clean.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Exit code 128 if not in git directory. +GS=$(git status --porcelain=v2 2>/dev/null) +GS=$? +if [ $GS -ne 128 ] || [ $GS -ne 0 ]; then + echo "Please re-run \"make build\" and checkout the following changes to git" + git status + exit 1 +fi