From ea057aa75eef59444208802b964292a675a91a8c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:08:01 +0100 Subject: [PATCH 1/2] add --- .github/workflows/vale.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 73100ca5893..1ea76b8755f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and Suggest +name: Vale Lint on: pull_request: @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: @@ -37,8 +37,10 @@ jobs: for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" vale --output=JSON $file > vale_output.json + echo "Vale output for $file:" cat vale_output.json - cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl + cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (if .Suggestions != null and .Suggestions | length > 0 then .Suggestions[0] else null end)}' > rdjson_output.jsonl + echo "Reviewdog JSONL output for $file:" cat rdjson_output.jsonl done env: @@ -50,6 +52,7 @@ jobs: name: vale-results path: rdjson_output.jsonl + suggest: # Reviewdog suggestion job runs-on: ubuntu-latest needs: vale # This ensures the suggest job runs after the vale job From a870091f7c37f0bcf35eda937d6649d4f5ece9e8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:09:22 +0100 Subject: [PATCH 2/2] add --- .github/workflows/vale.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1ea76b8755f..138b2a167be 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Lint and suggest on: pull_request: @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -34,14 +34,10 @@ jobs: - name: Run Vale on changed files run: | + echo "[]" > rdjson_output.jsonl for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file > vale_output.json - echo "Vale output for $file:" - cat vale_output.json - cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (if .Suggestions != null and .Suggestions | length > 0 then .Suggestions[0] else null end)}' > rdjson_output.jsonl - echo "Reviewdog JSONL output for $file:" - cat rdjson_output.jsonl + vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -52,7 +48,6 @@ jobs: name: vale-results path: rdjson_output.jsonl - suggest: # Reviewdog suggestion job runs-on: ubuntu-latest needs: vale # This ensures the suggest job runs after the vale job