From 2b5da93cdca77a22c89815e9b806dff47e47816c Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Tue, 22 Aug 2023 16:04:16 -0400 Subject: [PATCH] chore(infra): clean build check will log recommended steps (#28044) Issue number: N/A --------- ## What is the current behavior? When the CI process detects a diff between the output in CI after running `npm run build` versus the checked out branch, it will log the diff and exit. It isn't very clear to developers what they need to do or why this job step exists. ## What is the new behavior? - Logs a prettier error message to the developer to let them know the steps they can take when a diff is detected in CI ![CleanShot 2023-08-22 at 15 05 03](https://github.com/ionic-team/ionic-framework/assets/13732623/0397523e-5f4d-4ab6-8a2e-d9ecc4d085ba) Example run: https://github.com/ionic-team/ionic-framework/actions/runs/5942940488/job/16117074372?pr=28044 ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- .../actions/test-core-clean-build/action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions/test-core-clean-build/action.yml b/.github/workflows/actions/test-core-clean-build/action.yml index f7b55d7465..ae41a8924f 100644 --- a/.github/workflows/actions/test-core-clean-build/action.yml +++ b/.github/workflows/actions/test-core-clean-build/action.yml @@ -13,6 +13,15 @@ runs: path: ./core filename: CoreBuild.zip - name: Check Diff - run: git diff --exit-code + run: | + git diff --exit-code || { + echo -e "\033[1;31m⚠️ Error: Differences Detected ⚠️\033[0m" + echo -e "\033[1;31mThere are uncommitted changes between the build outputs from CI and your branch.\033[0m" + echo -e "\033[1;31mPlease ensure you have followed these steps:\033[0m" + echo -e "\033[1;31m1. Run 'npm run build' locally to generate the latest build output.\033[0m" + echo -e "\033[1;31m2. Commit and push all necessary changes to your branch.\033[0m" + echo -e "\033[1;31m3. Compare and validate the differences before proceeding.\033[0m" + exit 1 + } shell: bash working-directory: ./core