From 1f6b0edef99e361b9de3109b0ae70aeea90c34c4 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 20 Dec 2023 21:54:13 +0000 Subject: [PATCH] handle no file matching Signed-off-by: Eric --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d66abe536..3b90b0baf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -52,10 +52,11 @@ jobs: working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} run: | git fetch origin main - CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB origin/main | grep -E "\.(js|ts|tsx)$") + CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB origin/main | grep -E "\.(js|ts|tsx)$" || true) if [ -n "$CHANGED_FILES" ]; then echo "Linting changed files..." yarn lint $CHANGED_FILES else echo "No JavaScript/TypeScript files changed." + exit 0 fi \ No newline at end of file