Skip to content

Commit

Permalink
improve lint workflow to avoid fast fail (opensearch-project#1378) (o…
Browse files Browse the repository at this point in the history
…pensearch-project#1384)

(cherry picked from commit e3116ca)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 305e037)
  • Loading branch information
opensearch-trigger-bot[bot] authored and A9 Swift Project User committed Feb 1, 2024
1 parent 479fd5e commit 6e2989f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,12 @@ jobs:
- name: Lint Changed Files
run: |
jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | sort | uniq > /tmp/changed_files.txt
CHANGED_FILES=$(cat /tmp/changed_files.txt)
echo "These are the changed files: $CHANGED_FILES"
CHANGED_FILES=($(jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | grep '.\+.\(js\|ts\|tsx\)$' | sort -u))
if [[ -n "$CHANGED_FILES" ]]; then
echo "Linting changed files..."
while IFS= read -r file; do
if [[ $file == *.js || $file == *.ts || $file == *.tsx ]]; then
echo "linting file $file"
yarn lint "$file"
fi
done < /tmp/changed_files.txt
echo 'These are the changed files:'
printf '%s\n' "${CHANGED_FILES[@]}"
yarn lint "${CHANGED_FILES[@]}"
else
echo "No matched files to lint."
fi
working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
4 changes: 2 additions & 2 deletions auto_sync_commit_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"last_github_commit": "e28cb3800851b427ce3c47858aca482d1b18fcb0",
"last_gitfarm_commit": "8c84154dd5cb4689fafd640663171469e6f7082d"
"last_github_commit": "305e0370bfb0855458bcce84359141284bdf777e",
"last_gitfarm_commit": "065be22ca9fa8f7c20be437de3751e3b3ac9dc0f"
}

0 comments on commit 6e2989f

Please sign in to comment.