From ff1d6a62778709e6d907bc4faf6f4848353525f8 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 7 Jan 2024 23:54:03 +0100 Subject: [PATCH] ci fix. --- .github/ci/build.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/ci/build.sh b/.github/ci/build.sh index e2ec747..8b47d09 100755 --- a/.github/ci/build.sh +++ b/.github/ci/build.sh @@ -17,7 +17,10 @@ cargo fmt -- --check # so the diff will show this PR's effect git remote add upstream https://github.com/embassy-rs/stm32-data git fetch --depth 15 upstream main +set +e git clone --depth 1 --branch stm32-data-$(git merge-base HEAD upstream/main) https://github.com/embassy-rs/stm32-data-generated/ build -q +DIFF_OK=$? +set -e # move the sources directory out of the cache if it exists mv /ci/cache/sources ./sources || true @@ -27,12 +30,18 @@ mv /ci/cache/sources ./sources || true # move the sources directory into the cache mv ./sources /ci/cache/sources -# upload diff -( - cd build - git add . - git diff --staged --color data | aha --black > /ci/artifacts/diff.html -) +if [ $DIFF_OK -eq 0 ]; then + # upload diff + ( + cd build + git add . + git diff --staged --color data | aha --black > /ci/artifacts/diff.html + ) + + cat > /ci/comment.md < /ci/comment.md <