From cd7e444eef95b21392f555e8678ff0937c6519f4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:31:42 +0100 Subject: [PATCH 01/58] update workflow --- .github/workflows/vale.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 55bf36f229f..16bea57c793 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,21 +58,36 @@ jobs: fi done - - name: Run vale + - name: Check for Vale issues + id: check-vale + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + shell: bash + run: | + set +e + vale ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + exit_code=$? + echo "Exit code: $exit_code" + if [ $exit_code -ne 0 ]; then + echo "issues_found=true" >> $GITHUB_OUTPUT + else + echo "issues_found=false" >> $GITHUB_OUTPUT + fi + + - name: Run Vale (Annotations) if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check + reporter: github-check # Use 'github-check' to post annotations without failing the check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + fail_on_error: false # Ensure the step doesn't fail even if issues are found - name: Post summary comment - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + if: ${{ steps.check-vale.outputs.issues_found == '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="❗️Oh no, Vale linting found some issues! 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" From 5a49bfd6d7b1937897748fb337802f5e92d616b8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:43:23 +0100 Subject: [PATCH 02/58] add warning --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 16bea57c793..b7eec489631 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -64,7 +64,7 @@ jobs: shell: bash run: | set +e - vale ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + vale --minAlertLevel=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} exit_code=$? echo "Exit code: $exit_code" if [ $exit_code -ne 0 ]; then @@ -83,6 +83,7 @@ jobs: separator: ' ' version: '2.27.0' fail_on_error: false # Ensure the step doesn't fail even if issues are found + level: 'warning' # Set the level to 'warning' to post annotations as warnings - name: Post summary comment if: ${{ steps.check-vale.outputs.issues_found == 'true' }} From e74b899b2c612f1668b0dda030b50624ae7e7ed7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:47:39 +0100 Subject: [PATCH 03/58] add warning --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b7eec489631..4f48d5897ae 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -64,7 +64,7 @@ jobs: shell: bash run: | set +e - vale --minAlertLevel=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + vale --errorLevel=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} exit_code=$? echo "Exit code: $exit_code" if [ $exit_code -ne 0 ]; then @@ -73,7 +73,7 @@ jobs: echo "issues_found=false" >> $GITHUB_OUTPUT fi - - name: Run Vale (Annotations) + - name: Run Vale (annotations) if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: @@ -83,7 +83,7 @@ jobs: separator: ' ' version: '2.27.0' fail_on_error: false # Ensure the step doesn't fail even if issues are found - level: 'warning' # Set the level to 'warning' to post annotations as warnings + level: warning - name: Post summary comment if: ${{ steps.check-vale.outputs.issues_found == 'true' }} From 5763354d267554988a79badd64b574b5c4c43ba8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:50:44 +0100 Subject: [PATCH 04/58] add gh cli --- .github/workflows/vale.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4f48d5897ae..56b085059a8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -85,6 +85,10 @@ jobs: fail_on_error: false # Ensure the step doesn't fail even if issues are found level: warning + + - name: Install GitHub CLI + run: sudo apt-get install -y gh + - name: Post summary comment if: ${{ steps.check-vale.outputs.issues_found == 'true' }} run: | From e0d8c808871bac0baef61ee8b03b1a483ced6c55 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:53:45 +0100 Subject: [PATCH 05/58] add failure --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 56b085059a8..132f9cbcef7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -82,15 +82,16 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: false # Ensure the step doesn't fail even if issues are found + fail_on_error: true # Ensure the step doesn't fail even if issues are found level: warning + continue-on-error: true - name: Install GitHub CLI run: sudo apt-get install -y gh - name: Post summary comment - if: ${{ steps.check-vale.outputs.issues_found == 'true' }} + if: steps.run-vale.outcome == 'failure' run: | COMMENT="❗️Oh no, Vale linting found some issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n\n' From c12216baccf792d772d65afdc647c3a67d431e86 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 10:56:33 +0100 Subject: [PATCH 06/58] update --- .github/workflows/vale.yml | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 132f9cbcef7..5eeaef5c72b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,40 +58,21 @@ jobs: fi done - - name: Check for Vale issues - id: check-vale - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - shell: bash - run: | - set +e - vale --errorLevel=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} - exit_code=$? - echo "Exit code: $exit_code" - if [ $exit_code -ne 0 ]; then - echo "issues_found=true" >> $GITHUB_OUTPUT - else - echo "issues_found=false" >> $GITHUB_OUTPUT - fi - - - name: Run Vale (annotations) + - name: Run Vale + id: run-vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check # Use 'github-check' to post annotations without failing the check + reporter: github-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: true # Ensure the step doesn't fail even if issues are found - level: warning - continue-on-error: true - + fail_on_error: true # Make the step fail on linting errors + continue-on-error: true # Continue the workflow even if this step fails - - name: Install GitHub CLI - run: sudo apt-get install -y gh - - name: Post summary comment - if: steps.run-vale.outcome == 'failure' + if: steps.run-vale.outcome == 'failure' # Run only if the "Run Vale" step failed run: | COMMENT="❗️Oh no, Vale linting found some issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n\n' From feabd2731a80e3e498a6701b2d59a87d7a519aa5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:03:56 +0100 Subject: [PATCH 07/58] update --- .github/workflows/vale.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5eeaef5c72b..ff31ad6acef 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -69,8 +69,12 @@ jobs: separator: ' ' version: '2.27.0' fail_on_error: true # Make the step fail on linting errors + level: warning continue-on-error: true # Continue the workflow even if this step fails + - name: Install GitHub CLI + run: sudo apt-get install -y gh + - name: Post summary comment if: steps.run-vale.outcome == 'failure' # Run only if the "Run Vale" step failed run: | From 9f44d1858045465512032127bc379a69c4eabc79 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:08:42 +0100 Subject: [PATCH 08/58] update --- .github/workflows/vale.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ff31ad6acef..fbc63db0c9c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,8 +58,22 @@ jobs: fi done - - name: Run Vale - id: run-vale + - name: Check for Vale issues + id: check-vale + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + shell: bash + run: | + set +e + vale --exit-level=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + exit_code=$? + echo "Exit code: $exit_code" + if [ $exit_code -ne 0 ]; then + echo "issues_found=true" >> $GITHUB_OUTPUT + else + echo "issues_found=false" >> $GITHUB_OUTPUT + fi + + - name: Run Vale (annotations) if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: @@ -68,15 +82,14 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: true # Make the step fail on linting errors - level: warning - continue-on-error: true # Continue the workflow even if this step fails + fail_on_error: false # Do not fail the step + level: warning # Include warnings in annotations - name: Install GitHub CLI run: sudo apt-get install -y gh - name: Post summary comment - if: steps.run-vale.outcome == 'failure' # Run only if the "Run Vale" step failed + if: ${{ steps.check-vale.outputs.issues_found == 'true' }} run: | COMMENT="❗️Oh no, Vale linting found some issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n\n' From 193ef1eb51854d31cefde2de9f0df75d37079ebe Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:12:34 +0100 Subject: [PATCH 09/58] update --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index fbc63db0c9c..0b79b6a57cf 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -82,8 +82,9 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: false # Do not fail the step + fail_on_error: true # Do not fail the step level: warning # Include warnings in annotations + continue-on-error: true - name: Install GitHub CLI run: sudo apt-get install -y gh From 7afc640515e7ba5a8f750f64e263433c5bfc2be9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:14:34 +0100 Subject: [PATCH 10/58] update --- .github/workflows/vale.yml | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0b79b6a57cf..dda5f7edbd8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,41 +58,31 @@ jobs: fi done - - name: Check for Vale issues - id: check-vale - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - shell: bash - run: | - set +e - vale --exit-level=warning ${{ steps.changed-files.outputs.all_changed_and_modified_files }} - exit_code=$? - echo "Exit code: $exit_code" - if [ $exit_code -ne 0 ]; then - echo "issues_found=true" >> $GITHUB_OUTPUT - else - echo "issues_found=false" >> $GITHUB_OUTPUT - fi - - - name: Run Vale (annotations) + - name: Run vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog + id: run-vale with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: true # Do not fail the step - level: warning # Include warnings in annotations - continue-on-error: true - - name: Install GitHub CLI - run: sudo apt-get install -y gh + - name: Check for Vale issues + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "::set-output name=issues_found::$(gh api -X GET \ + repos/${{ github.repository }}/check-runs \ + --paginate -F status=completed -F conclusion=neutral,failure,timed_out \ + | jq '.check_runs | length > 0')" + id: vale-issues - name: Post summary comment - if: ${{ steps.check-vale.outputs.issues_found == 'true' }} + if: ${{ steps.vale-issues.outputs.issues_found == 'true' }} run: | - COMMENT="❗️Oh no, Vale linting found some issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** 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" From 5df20a19331c7f103f12e96223118a2f13a97e99 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:18:42 +0100 Subject: [PATCH 11/58] update --- .github/workflows/vale.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index dda5f7edbd8..15c15dfc751 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,11 +18,6 @@ jobs: with: fetch-depth: 1 - - name: List repository contents - run: | - pwd - ls -R - - name: Set up Python uses: actions/setup-python@v5 with: @@ -64,24 +59,21 @@ jobs: id: run-vale with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check + reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - - name: Check for Vale issues + - name: Check if issues were found if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - echo "::set-output name=issues_found::$(gh api -X GET \ - repos/${{ github.repository }}/check-runs \ - --paginate -F status=completed -F conclusion=neutral,failure,timed_out \ - | jq '.check_runs | length > 0')" + echo "::set-output name=issues_found::$(grep -c '::error' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json || true)" id: vale-issues - name: Post summary comment - if: ${{ steps.vale-issues.outputs.issues_found == 'true' }} + if: ${{ steps.vale-issues.outputs.issues_found != '0' }} run: | - COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + 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)" From 3a15b3036f3685beff49e1df39e91cf20d09055b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:24:57 +0100 Subject: [PATCH 12/58] update --- .github/workflows/vale.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 15c15dfc751..f0d0dc040ab 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -64,14 +64,21 @@ jobs: separator: ' ' version: '2.27.0' - - name: Check if issues were found + # Check if Reviewdog has returned any issues + - name: Check if Vale found issues + id: check-vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - echo "::set-output name=issues_found::$(grep -c '::error' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json || true)" - id: vale-issues + if grep -q '"conclusion":"neutral"' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json; then + echo "Vale found issues." + echo "issues_found=true" >> $GITHUB_ENV + else + echo "No Vale issues found." + echo "issues_found=false" >> $GITHUB_ENV + fi - name: Post summary comment - if: ${{ steps.vale-issues.outputs.issues_found != '0' }} + if: env.issues_found == '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' From ae7576cb68b48d44828c101c691e1584794e6463 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:32:03 +0100 Subject: [PATCH 13/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f0d0dc040ab..9d9d07820bb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -78,7 +78,7 @@ jobs: fi - name: Post summary comment - if: env.issues_found == 'true' + if: ${{ steps.check-vale.outputs.issues_found == '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' From 56e689bda04e75d0f0ad386fa45766043772ef7c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:36:43 +0100 Subject: [PATCH 14/58] update --- .github/workflows/vale.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9d9d07820bb..82aa38f4879 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,10 +53,10 @@ jobs: fi done - - name: Run vale + - name: Run Vale with Reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - uses: errata-ai/vale-action@reviewdog id: run-vale + uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check @@ -64,21 +64,18 @@ jobs: separator: ' ' version: '2.27.0' - # Check if Reviewdog has returned any issues - - name: Check if Vale found issues - id: check-vale + # Capture the exit code of Reviewdog to see if any issues were found + - name: Check for Vale issues if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - if grep -q '"conclusion":"neutral"' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json; then - echo "Vale found issues." - echo "issues_found=true" >> $GITHUB_ENV - else - echo "No Vale issues found." + if [ "${{ steps.run-vale.outcome }}" == "success" ]; then echo "issues_found=false" >> $GITHUB_ENV + else + echo "issues_found=true" >> $GITHUB_ENV fi - name: Post summary comment - if: ${{ steps.check-vale.outputs.issues_found == 'true' }} + if: ${{ env.issues_found == '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' From c86b6c7713f17c2bd07f981c0ad78092c370a3bc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:40:10 +0100 Subject: [PATCH 15/58] update --- .github/workflows/vale.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 82aa38f4879..8d39066bd4a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -63,19 +63,22 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + level: warning # Adjust this to "error" or "warning" based on the issues you want to catch - # Capture the exit code of Reviewdog to see if any issues were found + # Capture the conclusion from Reviewdog - name: Check for Vale issues if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - if [ "${{ steps.run-vale.outcome }}" == "success" ]; then - echo "issues_found=false" >> $GITHUB_ENV - else + if grep -q '"conclusion":"neutral"' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json; then + echo "Vale found issues." echo "issues_found=true" >> $GITHUB_ENV + else + echo "No Vale issues found." + echo "issues_found=false" >> $GITHUB_ENV fi - name: Post summary comment - if: ${{ env.issues_found == 'true' }} + if: env.issues_found == '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' From 1b8429f3c5ecd4e82c8f1f98039776b1e9924918 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:45:43 +0100 Subject: [PATCH 16/58] update --- .github/workflows/vale.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8d39066bd4a..6e8bfdd0acb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -63,17 +63,15 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - level: warning # Adjust this to "error" or "warning" based on the issues you want to catch + fail_level: warning # Fail on warnings or higher levels - # Capture the conclusion from Reviewdog - - name: Check for Vale issues + # Check the exit code of Reviewdog + - name: Set issues_found if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - if grep -q '"conclusion":"neutral"' $GITHUB_WORKSPACE/../_temp/_github_workflow/*/annotations.json; then - echo "Vale found issues." + if [[ ${{ steps.run-vale.outcome }} == "failure" ]]; then echo "issues_found=true" >> $GITHUB_ENV else - echo "No Vale issues found." echo "issues_found=false" >> $GITHUB_ENV fi From 55092f0d6ea706e77688948aa351a1defebd7844 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 11:49:02 +0100 Subject: [PATCH 17/58] update --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6e8bfdd0acb..2baa2e539ec 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -63,7 +63,8 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_level: warning # Fail on warnings or higher levels + fail_on_error: true + level: warning # Check the exit code of Reviewdog - name: Set issues_found From 4c7dc695cf9f75cd912b45dacbbf5cbd0430c691 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:10:41 +0100 Subject: [PATCH 18/58] update --- .github/workflows/vale.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2baa2e539ec..b5c840d6371 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -56,6 +56,7 @@ jobs: - name: Run Vale with Reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: run-vale + continue-on-error: true # Allow the workflow to continue even if this step fails uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} @@ -63,24 +64,24 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: true + fail_on_error: true # Make the action fail if issues are found level: warning - # Check the exit code of Reviewdog + # Check if Vale found issues - name: Set issues_found if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + id: set_issues_found run: | - if [[ ${{ steps.run-vale.outcome }} == "failure" ]]; then + if [ "${{ steps.run-vale.outcome }}" == "failure" ]; then echo "issues_found=true" >> $GITHUB_ENV else echo "issues_found=false" >> $GITHUB_ENV fi - name: Post summary comment - if: env.issues_found == 'true' + if: ${{ steps.set_issues_found.outputs.issues_found == '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="❗️Oh no, Vale found some linting issues! 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" From 9b7450a6ba346518bde96e220595e2555e98d1a0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:22:46 +0100 Subject: [PATCH 19/58] update --- .github/workflows/vale.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b5c840d6371..a26f0477476 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -64,18 +64,22 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - fail_on_error: true # Make the action fail if issues are found + fail_on_error: false level: warning + debug: true + env: + REVIEWDOG_FLAGS: '-tee' # Output results to stdout - # Check if Vale found issues - - name: Set issues_found + - name: Check for Vale issues using grep if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: set_issues_found + id: check_vale_issues run: | - if [ "${{ steps.run-vale.outcome }}" == "failure" ]; then - echo "issues_found=true" >> $GITHUB_ENV + # Capture the logs of the previous step + grep_output=$(grep -E '"severity": "WARNING"' <<< "${{ steps.run-vale.outputs.output }}") + if [ -n "$grep_output" ]; then + echo "issues_found=true" >> $GITHUB_OUTPUT else - echo "issues_found=false" >> $GITHUB_ENV + echo "issues_found=false" >> $GITHUB_OUTPUT fi - name: Post summary comment From 69d8ae921d31d251774f4bae6bb6982fd46b82b9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:36:23 +0100 Subject: [PATCH 20/58] update --- .github/workflows/vale.yml | 56 ++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a26f0477476..9b998130ff7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,13 +18,22 @@ jobs: with: fetch-depth: 1 + - name: List repository contents + run: | + pwd + ls -R + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install Vale - run: pip install vale==2.27.0 # Install a stable version of Vale + run: pip install vale==2.27.0 # Install Vale + + - name: Install Reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin/ - name: Get changed files id: changed-files @@ -38,13 +47,13 @@ jobs: if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + echo "${{ steps.changed-files.outputs.all_changed_files }}" - name: Confirm files exist if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | echo "Checking if files exist..." - for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do if [ -f "$file" ]; then echo "Found: $file" else @@ -53,41 +62,40 @@ jobs: fi done - - name: Run Vale with Reviewdog + - name: Run Vale and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: run-vale - continue-on-error: true # Allow the workflow to continue even if this step fails - uses: errata-ai/vale-action@reviewdog - with: - token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check - files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} - separator: ' ' - version: '2.27.0' - fail_on_error: false - level: warning - debug: true - env: - REVIEWDOG_FLAGS: '-tee' # Output results to stdout + run: | + # Run Vale and output results in JSON format + vale --output=JSON ${{ steps.changed-files.outputs.all_changed_files }} > vale_output.json - - name: Check for Vale issues using grep + - name: Check for Vale issues if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: check_vale_issues run: | - # Capture the logs of the previous step - grep_output=$(grep -E '"severity": "WARNING"' <<< "${{ steps.run-vale.outputs.output }}") - if [ -n "$grep_output" ]; then + # Check if any warnings are present in the output + if grep -q '"Severity":"warning"' vale_output.json; then echo "issues_found=true" >> $GITHUB_OUTPUT else echo "issues_found=false" >> $GITHUB_OUTPUT fi + - name: Run Reviewdog + if: ${{ steps.check_vale_issues.outputs.issues_found == 'true' }} + run: | + # Feed the Vale output to Reviewdog to create annotations + cat vale_output.json | reviewdog -f=rdjson -name=vale \ + -reporter=github-pr-check -fail-on-error=false \ + -filter-mode=added -level=warning + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Post summary comment - if: ${{ steps.set_issues_found.outputs.issues_found == 'true' }} + if: ${{ steps.check_vale_issues.outputs.issues_found == 'true' }} run: | - COMMENT="❗️Oh no, Vale found some linting issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + 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)" + COMMENT+="➡️ [View detailed report](${{ github.event.pull_request.html_url }}/files)" gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 26fd03f55c72a0e5e8c34bc848e5b60137d7c193 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:40:41 +0100 Subject: [PATCH 21/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9b998130ff7..64081984892 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -74,7 +74,7 @@ jobs: id: check_vale_issues run: | # Check if any warnings are present in the output - if grep -q '"Severity":"warning"' vale_output.json; then + if grep -qi '"severity": *"warning"' vale_output.json; then echo "issues_found=true" >> $GITHUB_OUTPUT else echo "issues_found=false" >> $GITHUB_OUTPUT From 5c93ab2fdaf399eaa42584d228775166f5a25697 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:46:05 +0100 Subject: [PATCH 22/58] update --- .github/workflows/vale.yml | 57 +++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 64081984892..23330e367c9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,11 +29,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale==2.27.0 # Install Vale - - - name: Install Reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin/ + run: pip install vale==2.27.0 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -47,13 +43,13 @@ jobs: if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_files }}" + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - name: Confirm files exist if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | echo "Checking if files exist..." - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do if [ -f "$file" ]; then echo "Found: $file" else @@ -62,40 +58,37 @@ jobs: fi done - - name: Run Vale and capture output + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: run-vale - run: | - # Run Vale and output results in JSON format - vale --output=JSON ${{ steps.changed-files.outputs.all_changed_files }} > vale_output.json + id: vale-lint + 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: Check for Vale issues + - name: Check Vale issues and set output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: check_vale_issues run: | - # Check if any warnings are present in the output - if grep -qi '"severity": *"warning"' vale_output.json; then - echo "issues_found=true" >> $GITHUB_OUTPUT + # Checking if reviewdog reported any issues + vale_issues=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments[].body' | grep 'reviewdog') + if [[ -n "$vale_issues" ]]; then + echo "Vale issues found!" + echo "::set-output name=vale_issues::true" else - echo "issues_found=false" >> $GITHUB_OUTPUT + echo "No Vale issues found." + echo "::set-output name=vale_issues::false" fi - - name: Run Reviewdog - if: ${{ steps.check_vale_issues.outputs.issues_found == 'true' }} - run: | - # Feed the Vale output to Reviewdog to create annotations - cat vale_output.json | reviewdog -f=rdjson -name=vale \ - -reporter=github-pr-check -fail-on-error=false \ - -filter-mode=added -level=warning - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Post summary comment - if: ${{ steps.check_vale_issues.outputs.issues_found == 'true' }} + - name: Post summary comment if issues found + if: ${{ steps.vale-lint.outputs.vale_issues == 'true' }} 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="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + COMMENT+=$'\n' COMMENT+=$'\n\n' - COMMENT+="➡️ [View detailed report](${{ github.event.pull_request.html_url }}/files)" + 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 }} From 4fde9f89517fcd7e834fbc619bf18a4dfd9d32dc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:50:13 +0100 Subject: [PATCH 23/58] update --- .github/workflows/vale.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 23330e367c9..0509338074a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,34 +58,34 @@ jobs: fi done - - name: Run Vale with reviewdog + - name: Run Vale with reviewdog and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check + level: warning files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - - name: Check Vale issues and set output + - name: Check for Vale issues if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + id: check-vale-issues run: | - # Checking if reviewdog reported any issues - vale_issues=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments[].body' | grep 'reviewdog') - if [[ -n "$vale_issues" ]]; then - echo "Vale issues found!" + if grep -q "WARNING" <<< "${{ steps.vale-lint.outputs.github_check }}"; then + echo "Issues found." echo "::set-output name=vale_issues::true" else - echo "No Vale issues found." + echo "No issues found." echo "::set-output name=vale_issues::false" fi - name: Post summary comment if issues found - if: ${{ steps.vale-lint.outputs.vale_issues == 'true' }} + if: ${{ steps.check-vale-issues.outputs.vale_issues == 'true' }} run: | - COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + 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)" From e7f5301e2577f1d7f32879285ce60ffc1c1c5241 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:55:06 +0100 Subject: [PATCH 24/58] update --- .github/workflows/vale.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0509338074a..0caa6eabf44 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -70,20 +70,20 @@ jobs: separator: ' ' version: '2.27.0' - - name: Check for Vale issues + - name: Check Vale issues and set output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: check-vale-issues run: | - if grep -q "WARNING" <<< "${{ steps.vale-lint.outputs.github_check }}"; then + vale_output=$(cat /home/runner/vale_output.txt) + if grep -q "WARNING" <<< "$vale_output"; then echo "Issues found." - echo "::set-output name=vale_issues::true" + echo "vale_issues=true" >> $GITHUB_ENV else echo "No issues found." - echo "::set-output name=vale_issues::false" + echo "vale_issues=false" >> $GITHUB_ENV fi - name: Post summary comment if issues found - if: ${{ steps.check-vale-issues.outputs.vale_issues == 'true' }} + if: ${{ env.vale_issues == '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' @@ -92,3 +92,4 @@ jobs: gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + vale_issues: ${{ env.vale_issues }} From dcf0f1407a54714eaac1ffa28fedcf0ddfaf5084 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 12:57:54 +0100 Subject: [PATCH 25/58] update --- .github/workflows/vale.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0caa6eabf44..f73bfa5b5d3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -70,11 +70,10 @@ jobs: separator: ' ' version: '2.27.0' - - name: Check Vale issues and set output - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + - name: Check if Vale found any issues + id: check-vale-issues run: | - vale_output=$(cat /home/runner/vale_output.txt) - if grep -q "WARNING" <<< "$vale_output"; then + if [[ "$(gh run view --json conclusion --jq '.conclusion')" != "success" ]]; then echo "Issues found." echo "vale_issues=true" >> $GITHUB_ENV else From 194b1e66917610b09fef07e62157013325f6825b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:04:53 +0100 Subject: [PATCH 26/58] update --- .github/workflows/vale.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f73bfa5b5d3..00582cdc8b7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -70,21 +70,23 @@ jobs: separator: ' ' version: '2.27.0' - - name: Check if Vale found any issues + - name: Check Vale JSON output for issues + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: check-vale-issues run: | - if [[ "$(gh run view --json conclusion --jq '.conclusion')" != "success" ]]; then - echo "Issues found." + vale_output=$(jq '.[] | select(.severity=="WARNING" or .severity=="ERROR")' /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl) + if [[ -n "$vale_output" ]]; then + echo "Vale found issues." echo "vale_issues=true" >> $GITHUB_ENV else - echo "No issues found." + echo "No Vale issues found." echo "vale_issues=false" >> $GITHUB_ENV fi - name: Post summary comment if issues found - if: ${{ env.vale_issues == 'true' }} + if: env.vale_issues == '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="❗️Oh no, some Vale linting found issues! Please check the **Files changed** 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)" From 14f32e47c365a324d3a5d0503eedcc3a428d24f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:08:22 +0100 Subject: [PATCH 27/58] update --- .github/workflows/vale.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 00582cdc8b7..5d18f12ffa0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,7 +58,7 @@ jobs: fi done - - name: Run Vale with reviewdog and capture output + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog @@ -70,23 +70,39 @@ jobs: separator: ' ' version: '2.27.0' + - name: Check if Vale output file exists + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then + echo "Vale output file exists." + cat /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl + else + echo "Vale output file not found." + exit 1 + fi + - name: Check Vale JSON output for issues if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: check-vale-issues run: | - vale_output=$(jq '.[] | select(.severity=="WARNING" or .severity=="ERROR")' /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl) - if [[ -n "$vale_output" ]]; then - echo "Vale found issues." - echo "vale_issues=true" >> $GITHUB_ENV + if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then + vale_output=$(jq '.[] | select(.severity=="WARNING" or .severity=="ERROR")' /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl) + if [[ -n "$vale_output" ]]; then + echo "Vale found issues." + echo "vale_issues=true" >> $GITHUB_ENV + else + echo "No Vale issues found." + echo "vale_issues=false" >> $GITHUB_ENV + fi else - echo "No Vale issues found." + echo "Vale output file not found, skipping JSON check." echo "vale_issues=false" >> $GITHUB_ENV fi - name: Post summary comment if issues found if: env.vale_issues == 'true' run: | - COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." + 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)" From e0b5c29d390b697d9de9f1ca01047aa3951dbb48 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:10:49 +0100 Subject: [PATCH 28/58] update --- .github/workflows/vale.yml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5d18f12ffa0..6b7e9b089cd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,7 +58,7 @@ jobs: fi done - - name: Run Vale with reviewdog + - name: Run Vale with reviewdog and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog @@ -70,32 +70,15 @@ jobs: separator: ' ' version: '2.27.0' - - name: Check if Vale output file exists - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then - echo "Vale output file exists." - cat /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl - else - echo "Vale output file not found." - exit 1 - fi - - - name: Check Vale JSON output for issues + - name: Check for Vale issues based on stderr output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: check-vale-issues run: | - if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then - vale_output=$(jq '.[] | select(.severity=="WARNING" or .severity=="ERROR")' /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl) - if [[ -n "$vale_output" ]]; then - echo "Vale found issues." - echo "vale_issues=true" >> $GITHUB_ENV - else - echo "No Vale issues found." - echo "vale_issues=false" >> $GITHUB_ENV - fi + if grep -q "WARNING" <(echo "${{ steps.vale-lint.outcome }}"); then + echo "Vale found issues." + echo "vale_issues=true" >> $GITHUB_ENV else - echo "Vale output file not found, skipping JSON check." + echo "No Vale issues found." echo "vale_issues=false" >> $GITHUB_ENV fi From dcfb9c5e976dc004713e940844f78577b3771bb0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:18:23 +0100 Subject: [PATCH 29/58] update --- .github/workflows/vale.yml | 44 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6b7e9b089cd..1f1fc0f8f99 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,19 +45,6 @@ jobs: echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Confirm files exist - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - echo "Checking if files exist..." - for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do - if [ -f "$file" ]; then - echo "Found: $file" - else - echo "File not found: $file" - exit 1 - fi - done - - name: Run Vale with reviewdog and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint @@ -65,31 +52,24 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check - level: warning + level: warning # Only warnings are being considered files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - - name: Check for Vale issues based on stderr output - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: check-vale-issues + - name: Post summary comment if Vale warnings found + if: ${{ always() }} run: | - if grep -q "WARNING" <(echo "${{ steps.vale-lint.outcome }}"); then - echo "Vale found issues." - echo "vale_issues=true" >> $GITHUB_ENV + # Check if any warnings were reported by Vale + vale_warnings=$(gh run view --log | grep -i "WARNING") + if [ -n "$vale_warnings" ]; then + COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them." + 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" else - echo "No Vale issues found." - echo "vale_issues=false" >> $GITHUB_ENV + echo "No warnings found, skipping comment." fi - - - name: Post summary comment if issues found - if: env.vale_issues == '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 }} - vale_issues: ${{ env.vale_issues }} From 2042e0ed3ae843852e75be745e126c34d5cd2da9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:20:51 +0100 Subject: [PATCH 30/58] update --- .github/workflows/vale.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1f1fc0f8f99..1e93f0185df 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,7 +45,7 @@ jobs: echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Run Vale with reviewdog and capture output + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog @@ -58,18 +58,12 @@ jobs: version: '2.27.0' - name: Post summary comment if Vale warnings found - if: ${{ always() }} + if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} run: | - # Check if any warnings were reported by Vale - vale_warnings=$(gh run view --log | grep -i "WARNING") - if [ -n "$vale_warnings" ]; then - COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them." - 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" - else - echo "No warnings found, skipping comment." - fi + COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them." + 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 }} From 05af0be6aa8601ce2d0905c549886de123d7f12c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:26:15 +0100 Subject: [PATCH 31/58] update --- styles/custom/Metrics.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 styles/custom/Metrics.yml diff --git a/styles/custom/Metrics.yml b/styles/custom/Metrics.yml deleted file mode 100644 index e319f78cac8..00000000000 --- a/styles/custom/Metrics.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Flesch-Kincaid grade level (%s) below 8." -link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests - -formula: | - (0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59 - -condition: "> 8.0" From ba379260c9505f73defbd52dfcfab35e60386908 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:27:24 +0100 Subject: [PATCH 32/58] update --- styles/custom/LatinAbbreviations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index f5962273440..902c2b3bb85 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,6 @@ extends: substitution message: "Avoid latin abbreviations: '%s'. Consider using '%s' instead." level: warning -ignorecase: false swap: - e.g.: for example From 98e4987e67cd5319d656d591baa75894fbff545c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:36:37 +0100 Subject: [PATCH 33/58] update --- .github/workflows/vale.yml | 1 + styles/custom/LatinAbbreviations.yml | 27 +++++++++++---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e93f0185df..9fb5d4b08b6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -56,6 +56,7 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + filter_mode: added - name: Post summary comment if Vale warnings found if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 902c2b3bb85..44a3c9d6e8c 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,20 +1,15 @@ +# LatinAbbreviations.yml extends: substitution -message: "Avoid latin abbreviations: '%s'. Consider using '%s' instead." +message: "Avoid Latin abbreviations: '%s'. Consider using '%s' instead." level: warning swap: - - e.g.: for example - - eg: for example - - e.g: for example - - i.e.: for example - - i.e.: that is - - etc.: and so on - - N.B.: Note - -action: - name: replace - params: - - for example - - that is - - and so on - - Note + 'e.g.': 'for example' + 'e.g': 'for example' + 'eg': 'for example' + 'i.e.': 'that is' + 'i.e': 'that is' + 'etc.': 'and so on' + 'etc': 'and so on' + 'N.B.': 'Note' + 'NB': 'Note' From 08ce3703d7bc4bc388c2ffb81da6e41c1e473cac Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:48:15 +0100 Subject: [PATCH 34/58] update --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9fb5d4b08b6..28c16c03cbd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,7 +44,12 @@ jobs: run: | echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - + + - name: Debugging - Show reviewdog diff output + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + gh pr view ${{ github.event.pull_request.number }} --json changedFiles + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint From aa62de1f917171a3f1d2f04c3354d5a5e622f28a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:54:29 +0100 Subject: [PATCH 35/58] update --- .github/workflows/vale.yml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 28c16c03cbd..23a7e2d6f4b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,17 +39,6 @@ jobs: website/**/*.md separator: ' ' - - name: Debugging - Print changed files - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - - name: Debugging - Show reviewdog diff output - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - gh pr view ${{ github.event.pull_request.number }} --json changedFiles - - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint @@ -57,19 +46,13 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check - level: warning # Only warnings are being considered + level: warning # Only flag warnings + filter_mode: added # Run on changed lines only files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - filter_mode: added - - name: Post summary comment if Vale warnings found + - name: Post warning in the job output if Vale issues found if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} run: | - COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them." - 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 }} + echo "::warning::Vale linting has detected warnings. Please check the details in the **Files changed** tab or the **Checks** tab." From 8d7c0095fa00897a5d8ec8cf333606b8bc9bb270 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:57:48 +0100 Subject: [PATCH 36/58] update --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 23a7e2d6f4b..06adb60590d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -52,7 +52,8 @@ jobs: separator: ' ' version: '2.27.0' - - name: Post warning in the job output if Vale issues found + - name: Add custom summary with warnings if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} run: | - echo "::warning::Vale linting has detected warnings. Please check the details in the **Files changed** tab or the **Checks** tab." + echo "## Vale Linting Summary" >> $GITHUB_STEP_SUMMARY + echo "❗️ Vale linting detected warnings. Please check the **Files changed** or **Checks** tabs." >> $GITHUB_STEP_SUMMARY From 571810b02100b1ba52117c4fe2f4e6615d128be7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:02:49 +0100 Subject: [PATCH 37/58] update --- .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 06adb60590d..177fdc6a398 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -55,5 +55,10 @@ jobs: - name: Add custom summary with warnings if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} run: | - echo "## Vale Linting Summary" >> $GITHUB_STEP_SUMMARY - echo "❗️ Vale linting detected warnings. Please check the **Files changed** or **Checks** tabs." >> $GITHUB_STEP_SUMMARY + 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 }} From ba096a713e9ba3525e0c259bfc7664a76f3f2562 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:09:19 +0100 Subject: [PATCH 38/58] update --- .github/workflows/vale.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 177fdc6a398..d8c35ede284 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,6 +39,25 @@ jobs: website/**/*.md separator: ' ' + - name: Debugging - Print changed files + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Changed files:" + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + + - name: Confirm files exist + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Checking if files exist..." + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + if [ -f "$file" ]; then + echo "Found: $file" + else + echo "File not found: $file" + exit 1 + fi + done + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint @@ -52,13 +71,12 @@ jobs: separator: ' ' version: '2.27.0' - - name: Add custom summary with warnings - if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }} + - name: Add PR comment if Vale found issues + if: failure() # This will run only if the Vale step fails (warnings are treated as failures) 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="❗️ Vale linting found warnings. Please check the **Files changed** tab for details." COMMENT+=$'\n\n' - COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" + COMMENT+="➡️ View the details here: [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 }} From 7902f084cc26628b0e47d5d48fb7b7e0dd5cecbf Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:14:01 +0100 Subject: [PATCH 39/58] update --- .github/workflows/vale.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d8c35ede284..d387768f2f5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,7 +58,7 @@ jobs: fi done - - name: Run Vale with reviewdog + - name: Run Vale with reviewdog and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog @@ -71,8 +71,16 @@ jobs: separator: ' ' version: '2.27.0' - - name: Add PR comment if Vale found issues - if: failure() # This will run only if the Vale step fails (warnings are treated as failures) + - name: Check Vale output for warnings + if: ${{ steps.vale-lint.conclusion == 'neutral' }} # Reviewdog treats warnings as 'neutral' conclusion + run: | + echo "Vale found warnings!" + echo "vale_issues=true" >> $GITHUB_ENV + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Post comment if warnings were found + if: ${{ env.vale_issues == 'true' }} run: | COMMENT="❗️ Vale linting found warnings. Please check the **Files changed** tab for details." COMMENT+=$'\n\n' @@ -80,3 +88,4 @@ jobs: gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + vale_issues: ${{ env.vale_issues }} From 78d8430ac99c4a5e8aa4dcd7a69243a56f969183 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:49:34 +0100 Subject: [PATCH 40/58] update --- .github/workflows/vale.yml | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d387768f2f5..b03b2b7a090 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,21 +44,8 @@ jobs: run: | echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - - name: Confirm files exist - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - echo "Checking if files exist..." - for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do - if [ -f "$file" ]; then - echo "Found: $file" - else - echo "File not found: $file" - exit 1 - fi - done - - - name: Run Vale with reviewdog and capture output + + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog @@ -70,22 +57,4 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - - - name: Check Vale output for warnings - if: ${{ steps.vale-lint.conclusion == 'neutral' }} # Reviewdog treats warnings as 'neutral' conclusion - run: | - echo "Vale found warnings!" - echo "vale_issues=true" >> $GITHUB_ENV - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Post comment if warnings were found - if: ${{ env.vale_issues == 'true' }} - run: | - COMMENT="❗️ Vale linting found warnings. Please check the **Files changed** tab for details." - COMMENT+=$'\n\n' - COMMENT+="➡️ View the details here: [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 }} - vale_issues: ${{ env.vale_issues }} + continue-on-error: true # Allow this step to fail without failing the entire workflow From 5a68a70779bfcf2257ea3d484f347f929ce68057 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:56:04 +0100 Subject: [PATCH 41/58] update --- .github/workflows/vale.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b03b2b7a090..4382dcdc897 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,16 +45,15 @@ jobs: echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Run Vale with reviewdog + - name: Run Vale with reviewdog and show detailed annotations if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check - level: warning # Only flag warnings - filter_mode: added # Run on changed lines only + reporter: github-pr-check # Use GitHub PR check reporter for detailed annotations + level: warning # Flag warnings as issues + filter_mode: added # Only analyze changed lines files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - continue-on-error: true # Allow this step to fail without failing the entire workflow From 4e9c9f62decb3ad9d9e99f495498e60c38777e49 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:58:36 +0100 Subject: [PATCH 42/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4382dcdc897..aed14b96e37 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -51,7 +51,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check # Use GitHub PR check reporter for detailed annotations + reporter: github-pr-review # Use GitHub PR check reporter for detailed annotations level: warning # Flag warnings as issues filter_mode: added # Only analyze changed lines files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} From 012e90c52a253e4e3adff0b774e3f9d5da62ef53 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:00:54 +0100 Subject: [PATCH 43/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index aed14b96e37..8137b819662 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -51,7 +51,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review # Use GitHub PR check reporter for detailed annotations + reporter: github-pr-annotations # Use GitHub PR check reporter for detailed annotations level: warning # Flag warnings as issues filter_mode: added # Only analyze changed lines files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} From 879607b0fc8db156409a7df42f9b00fecda3e7f8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:07:05 +0100 Subject: [PATCH 44/58] update --- .github/workflows/vale.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8137b819662..4ee1bb693cd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,15 +45,40 @@ jobs: echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Run Vale with reviewdog and show detailed annotations + - name: Run Vale with reviewdog if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-annotations # Use GitHub PR check reporter for detailed annotations + reporter: github-pr-check # Use GitHub PR check reporter for detailed annotations level: warning # Flag warnings as issues filter_mode: added # Only analyze changed lines files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + output: 'json' # Output the Vale results in JSON format for parsing + + - name: Check for Vale warnings + id: check-vale-warnings + run: | + if [[ $(jq '.warnings | length' < vale-output.json) -gt 0 ]]; then + echo "Vale found warnings or linting issues." + echo "has_warnings=true" >> $GITHUB_ENV + else + echo "No warnings or linting issues found." + echo "has_warnings=false" >> $GITHUB_ENV + fi + continue-on-error: true + + - name: Post comment if Vale finds issues + if: ${{ env.has_warnings == '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 }} + has_warnings: ${{ env.has_warnings }} From 20b9b7d74ea7cea7b76ef513b295d179ce6a520c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:11:21 +0100 Subject: [PATCH 45/58] update --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4ee1bb693cd..4963e4abcc8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -57,12 +57,12 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - output: 'json' # Output the Vale results in JSON format for parsing - name: Check for Vale warnings id: check-vale-warnings run: | - if [[ $(jq '.warnings | length' < vale-output.json) -gt 0 ]]; then + vale_result=$(grep -c 'warning' <(cat /home/runner/reviewdog_issues.txt || true)) + if [ "$vale_result" -gt 0 ]; then echo "Vale found warnings or linting issues." echo "has_warnings=true" >> $GITHUB_ENV else @@ -71,6 +71,7 @@ jobs: fi continue-on-error: true + - name: Post comment if Vale finds issues if: ${{ env.has_warnings == 'true' }} run: | From 1c985f401092a0452863ea40f73e43945c50d1db Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:16:23 +0100 Subject: [PATCH 46/58] update --- .github/workflows/vale.yml | 40 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4963e4abcc8..409beb10f16 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,38 +45,48 @@ jobs: echo "Changed files:" echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Run Vale with reviewdog + - name: Confirm files exist + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Checking if files exist..." + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + if [ -f "$file" ]; then + echo "Found: $file" + else + echo "File not found: $file" + exit 1 + fi + done + + - name: Run Vale and capture warnings if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check # Use GitHub PR check reporter for detailed annotations - level: warning # Flag warnings as issues - filter_mode: added # Only analyze changed lines + reporter: github-check + level: warning # Make sure Vale reports warnings files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + continue-on-error: true # Proceed even if warnings are found - name: Check for Vale warnings - id: check-vale-warnings + if: ${{ steps['vale-lint'].outcome == 'neutral' || steps['vale-lint'].outcome == 'success' }} run: | - vale_result=$(grep -c 'warning' <(cat /home/runner/reviewdog_issues.txt || true)) - if [ "$vale_result" -gt 0 ]; then - echo "Vale found warnings or linting issues." + warning_count=$(grep -c 'severity": "WARNING"' <(cat /home/runner/work/_actions/errata-ai/vale-action/reviewdog/output.log || true)) + if [ "$warning_count" -gt 0 ]; then + echo "Vale found warnings." echo "has_warnings=true" >> $GITHUB_ENV else - echo "No warnings or linting issues found." + echo "No warnings found." echo "has_warnings=false" >> $GITHUB_ENV fi - continue-on-error: true - - - name: Post comment if Vale finds issues - if: ${{ env.has_warnings == 'true' }} + - name: Post comment if Vale finds warnings + if: ${{ env.has_warnings == '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="❗️Some Vale linting warnings 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" From f449b0eb94798bd9115a03b186686b9457b245d9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:18:22 +0100 Subject: [PATCH 47/58] update --- .github/workflows/vale.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 409beb10f16..bf2e3678f3c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,38 +58,25 @@ jobs: fi done - - name: Run Vale and capture warnings + - name: Run Vale and report errors but don't fail if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check - level: warning # Make sure Vale reports warnings + level: error # Report as errors instead of warnings + fail_on_error: false # Ensure the check won't fail the entire CI files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - continue-on-error: true # Proceed even if warnings are found - - name: Check for Vale warnings - if: ${{ steps['vale-lint'].outcome == 'neutral' || steps['vale-lint'].outcome == 'success' }} + - name: Post comment if Vale finds errors + if: steps.vale-lint.outcome == 'success' run: | - warning_count=$(grep -c 'severity": "WARNING"' <(cat /home/runner/work/_actions/errata-ai/vale-action/reviewdog/output.log || true)) - if [ "$warning_count" -gt 0 ]; then - echo "Vale found warnings." - echo "has_warnings=true" >> $GITHUB_ENV - else - echo "No warnings found." - echo "has_warnings=false" >> $GITHUB_ENV - fi - - - name: Post comment if Vale finds warnings - if: ${{ env.has_warnings == 'true'}} - run: | - COMMENT="❗️Some Vale linting warnings were found! Please check the **Files changed** tab for detailed results and make the necessary updates." + COMMENT="❗️Vale linting found errors! 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 }} - has_warnings: ${{ env.has_warnings }} From 401874872e23bb01728e3d7cfd9cbbcd7efe6623 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:29:30 +0100 Subject: [PATCH 48/58] update --- .github/workflows/vale.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bf2e3678f3c..0566b837a74 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -64,17 +64,19 @@ jobs: uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check + reporter: github-pr-check level: error # Report as errors instead of warnings fail_on_error: false # Ensure the check won't fail the entire CI files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + filter_mode: added - - name: Post comment if Vale finds errors - if: steps.vale-lint.outcome == 'success' + - name: Post summary comment + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - COMMENT="❗️Vale linting found errors! Please check the **Files changed** tab for detailed results and make the necessary updates." + COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** 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" From 18cca3fccbf5b013c1c0a6563f258fa0301a0c3f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:31:25 +0100 Subject: [PATCH 49/58] update --- .github/workflows/vale.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0566b837a74..ed7ce4f6a3f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,22 +58,22 @@ jobs: fi done - - name: Run Vale and report errors but don't fail + - name: Run Vale on changed lines if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check - level: error # Report as errors instead of warnings - fail_on_error: false # Ensure the check won't fail the entire CI + reporter: github-check # Annotations will be posted in the PR + level: error # Report as errors to make issues clearer + filter_mode: added # Only analyze changed lines files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' - filter_mode: added + continue-on-error: true # Ensure workflow continues even if Vale finds issues - - name: Post summary comment - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + - name: Post summary comment if Vale finds issues + if: steps.vale-lint.outcome == 'failure' # Check if Vale found any linting issues run: | COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n' From e0576d0db8bbb0731ff0bb3af085a812d9a4d112 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:44:21 +0100 Subject: [PATCH 50/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ed7ce4f6a3f..d40211c59f7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -73,7 +73,7 @@ jobs: continue-on-error: true # Ensure workflow continues even if Vale finds issues - name: Post summary comment if Vale finds issues - if: steps.vale-lint.outcome == 'failure' # Check if Vale found any linting issues + if: steps.vale-lint.conclusion == 'neutral' # Check if Vale found any linting issues run: | COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n' From 84dbb3f336b6bb9c3913aa801c313c100630536b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:49:41 +0100 Subject: [PATCH 51/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d40211c59f7..bb769c0dd30 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -73,7 +73,7 @@ jobs: continue-on-error: true # Ensure workflow continues even if Vale finds issues - name: Post summary comment if Vale finds issues - if: steps.vale-lint.conclusion == 'neutral' # Check if Vale found any linting issues + if: steps.vale-lint.outcome == 'neutral' # Check if Vale found any linting issues run: | COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** tab for detailed results and make the necessary updates." COMMENT+=$'\n' From 4e9d99e4ac4f81a40fa325651e2389191d87fc54 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:53:43 +0100 Subject: [PATCH 52/58] update --- .github/workflows/vale.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bb769c0dd30..655893293b8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -73,12 +73,15 @@ jobs: continue-on-error: true # Ensure workflow continues even if Vale finds issues - name: Post summary comment if Vale finds issues - if: steps.vale-lint.outcome == 'neutral' # Check if Vale found any linting issues + if: always() # Always evaluate the step run: | - COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files changed** 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" + CHECK_RUN_URL="${{ steps.vale-lint.outputs.check_run_url }}" + if [[ "$CHECK_RUN_URL" == *"neutral"* ]]; then + 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' + 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" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 697483b4cb7ff670dd2d739b1c8f403d01481ec2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 15:58:03 +0100 Subject: [PATCH 53/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 655893293b8..902c25ce31d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -76,7 +76,7 @@ jobs: if: always() # Always evaluate the step run: | CHECK_RUN_URL="${{ steps.vale-lint.outputs.check_run_url }}" - if [[ "$CHECK_RUN_URL" == *"neutral"* ]]; then + if [[ "$CHECK_RUN_URL" == *"warning"* ]]; then 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' COMMENT+=$'\n\n' From eee1c68608be644799edcbb898b803389aef706b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:04:15 +0100 Subject: [PATCH 54/58] update --- .github/workflows/vale.yml | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 902c25ce31d..a3175e89efb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,30 +58,31 @@ jobs: fi done - - name: Run Vale on changed lines + - name: Run Vale on changed lines and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} id: vale-lint - uses: errata-ai/vale-action@reviewdog - with: - token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-check # Annotations will be posted in the PR - level: error # Report as errors to make issues clearer - filter_mode: added # Only analyze changed lines - files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} - separator: ' ' - version: '2.27.0' - continue-on-error: true # Ensure workflow continues even if Vale finds issues + run: | + /home/runner/vale --output=vale-output.json website/docs/docs/introduction.md || true - - name: Post summary comment if Vale finds issues - if: always() # Always evaluate the step + - name: Check Vale output for warnings/issues + id: check-vale-output run: | - CHECK_RUN_URL="${{ steps.vale-lint.outputs.check_run_url }}" - if [[ "$CHECK_RUN_URL" == *"warning"* ]]; then - 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' - 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" + if grep -q '"severity": "WARNING"' vale-output.json; then + echo "Vale found warnings or issues." + echo "has_warnings=true" >> $GITHUB_ENV + else + echo "No warnings or issues found." + echo "has_warnings=false" >> $GITHUB_ENV fi + + - name: Post summary comment if Vale finds issues + if: ${{ env.has_warnings == 'true'}} + 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' + 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 }} + has_warnings: ${{ env.has_warnings }} From 65d281eba2f1debbd5dbe8f826fe5c7c8d7384df Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:06:21 +0100 Subject: [PATCH 55/58] update --- .github/workflows/vale.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a3175e89efb..c899f4f2c21 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -60,9 +60,13 @@ jobs: - name: Run Vale on changed lines and capture output if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - id: vale-lint - run: | - /home/runner/vale --output=vale-output.json website/docs/docs/introduction.md || 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: Check Vale output for warnings/issues id: check-vale-output From c1b53c71736b39ff7820a695e29fb85243b6f0e4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:09:09 +0100 Subject: [PATCH 56/58] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c899f4f2c21..2ab6519bf54 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -71,7 +71,7 @@ jobs: - name: Check Vale output for warnings/issues id: check-vale-output run: | - if grep -q '"severity": "WARNING"' vale-output.json; then + if grep -i 'warning' vale-output.json; then echo "Vale found warnings or issues." echo "has_warnings=true" >> $GITHUB_ENV else From 758c130b4062fb090018ed2205d730652ba86938 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:14:27 +0100 Subject: [PATCH 57/58] update --- .github/workflows/vale.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2ab6519bf54..1f6d3ff035e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,35 +58,30 @@ jobs: fi done - - name: Run Vale on changed lines and capture output + - name: Run Vale and capture output if: ${{ steps.changed-files.outputs.any_changed == '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' + id: vale-lint + run: | + /home/runner/vale --output=vale-output.json ${{ steps.changed-files.outputs.all_changed_and_modified_files }} || true - - name: Check Vale output for warnings/issues + - 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 'warning' vale-output.json; then - echo "Vale found warnings or issues." - echo "has_warnings=true" >> $GITHUB_ENV + 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 warnings or issues found." - echo "has_warnings=false" >> $GITHUB_ENV + echo "No issues found." fi + continue-on-error: true - name: Post summary comment if Vale finds issues - if: ${{ env.has_warnings == 'true'}} + 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' 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 }} - has_warnings: ${{ env.has_warnings }} From 6c3516a45603a8f9645c5dd503f7958d006bb745 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 16:22:28 +0100 Subject: [PATCH 58/58] 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 }}