From ba096a713e9ba3525e0c259bfc7664a76f3f2562 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 15 Oct 2024 14:09:19 +0100 Subject: [PATCH] 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 }}