From 6c3516a45603a8f9645c5dd503f7958d006bb745 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:22:28 +0100 Subject: [PATCH] update --- .github/workflows/vale.yml | 43 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1f6d3ff035e..5feaaa12a20 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,30 +58,23 @@ jobs: fi done - - name: Run Vale and capture output + - name: Run vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: vale-lint - run: | - /home/runner/vale --output=vale-output.json ${{ steps.changed-files.outputs.all_changed_and_modified_files }} || true - - - name: Check for Vale issues and exit with code 78 if found - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: check-vale-output - run: | - if grep -i '"severity":' vale-output.json; then - echo "Vale found issues." - exit 78 # Exit with code 78 to mark the job as neutral - else - echo "No issues found." - fi - continue-on-error: true + uses: errata-ai/vale-action@reviewdog + with: + token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-check + files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + separator: ' ' + version: '2.27.0' - - name: Post summary comment if Vale finds issues - if: steps.check-vale-output.outcome == 'neutral' # Check if the step exited with code 78 - run: | - COMMENT="❗️Oh no, some Vale linting issues were found! Please check the **Files changed** tab for detailed results and make the necessary updates." - COMMENT+=$'\n\n' - COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" - gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Post summary comment +# if: ${{ steps.changed-files.outputs.any_changed == 'true' }} +# run: | +# COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files change** tab for detailed results and make the necessary updates." +# COMMENT+=$'\n' +# COMMENT+=$'\n\n' +# COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" +# gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}