Skip to content

Commit

Permalink
add conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexJameson committed Aug 22, 2024
1 parent 16cfd5a commit 57c4832
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/spellcheck-ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@ jobs:
echo "ALL_CHANGED_FILES: $ALL_CHANGED_FILES"
cspell_output=""
for file in $ALL_CHANGED_FILES; do
if [ "$file" = ".github/workflows/spellcheck-ru.yml" ]; then
echo "Skipping CSpell check for $file"
continue
fi
if [ "$file" = "cspell.json" ]; then
echo "Skipping CSpell check for $file"
continue
fi
echo "Running CSpell on $file..."
file_path="${GITHUB_WORKSPACE}/${file}"
echo "File path: $file_path"
file_content=$(cat "${file_path}")
cspell_errors=$(echo "$file_content" | cspell --config ${GITHUB_WORKSPACE}/cspell.json --no-must-find-files --exclude .github/workflows/spellcheck-ru.yml)
cspell_errors=$(echo "$file_content" | cspell --config cspell.json --show-suggestions)
if [ -n "$cspell_errors" ]; then
cspell_output+="CSpell errors in $file:\n$cspell_errors\n\n"
fi
Expand Down

0 comments on commit 57c4832

Please sign in to comment.