From 6dc9651cddc1c65a4022e4345f44af87870f0ee6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 19:35:40 +1000 Subject: [PATCH] Fix job changed-files in ci.yml When no crate is changed, command cut will fail. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e941f2b..39e9f04b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -euxo pipefail - crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2)" + crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2 || echo)" has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT"