From 970dd4ff05930e756bb37de024481ee55514f883 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:17:42 +0100 Subject: [PATCH] add --- .github/workflows/vale.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 138b2a167be..c712dc58d12 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,9 +35,14 @@ jobs: - name: Run Vale on changed files run: | echo "[]" > rdjson_output.jsonl - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + vale_output=$(vale --output=JSON "$file") + if [ $? -eq 0 ]; then + echo "$vale_output" | jq -c '.[] | {file: "'"$file"'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + else + echo "Error processing $file" + fi done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}