From 2042e0ed3ae843852e75be745e126c34d5cd2da9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 13:20:51 +0100 Subject: [PATCH] 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 }}