From 1a38278f2ae8c7dc6af1ba03c028eac8307c0190 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Thu, 3 Feb 2022 12:04:14 +0100 Subject: [PATCH] (actions) check if build folder is up-to-date --- .github/workflows/npm.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 4ba7aff9..713eed30 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -40,7 +40,15 @@ jobs: - name: Test run: | npm test --prefix ${{ matrix.package }} - - name: Success + - name: Build is up-to-date run: | - echo -e "\e[35m\e[1mThe build of '${{ matrix.package }}' has succeeded, please make sure that the 'build'/'dist' folder is up-to-date\e[0m" + echo -e "\e[1m\e[35mChecking the build folder(dist) is up-to-date with the library\e[0m" + changed_build_files=$(git -C "$(git rev-parse --show-toplevel)" diff --name-only HEAD -- ${{ matrix.package }}/dist) + if [ -n "$changed_build_files" ] + then + echo -e "\e[1m\e[31mBuild folder is out-of-sync with library. Build library, npm run build, and (ammend) commit\e[0m" + exit 1 + else + echo -e "\e[1m\e[32mBuild folder is up-to-date with library\e[0m" + fi