From 33ad76efa7a75d854f1d84e9da47698dc97ec075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Mar 2022 11:24:22 -0500 Subject: [PATCH] chore: ensure build step does not produce dirty changes --- .github/workflows/ci.yml | 3 +++ scripts/assert-dir-git-clean.sh | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100755 scripts/assert-dir-git-clean.sh 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..2dcefe0119cd --- /dev/null +++ b/scripts/assert-dir-git-clean.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Must run at a git working dir +if [ -n "$(git status --porcelain=v1 2>/dev/null)" ]; then + echo "Please re-run \"make build\" and checkout the following changes to git" + git status + exit 1 +fi