Skip to content

Commit

Permalink
handle no file matching
Browse files Browse the repository at this point in the history
Signed-off-by: Eric <[email protected]>
  • Loading branch information
mengweieric committed Dec 20, 2023
1 parent 5b3ce68 commit 1f6b0ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1f6b0ed

Please sign in to comment.