Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Jun 14, 2024
1 parent 970dd4f commit 1274c3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ 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=$(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
echo "$vale_output" | jq -c --arg file "$file" '.[] | {file: $file, line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl
else
echo "Error processing $file"
fi
done
echo "Vale output:"
cat rdjson_output.jsonl
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}

Expand Down

0 comments on commit 1274c3c

Please sign in to comment.