From 6196f7c5c19bf473cbf621273102a1ebc16f4f4f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 18 Oct 2024 15:03:34 +0100 Subject: [PATCH 1/2] add skip --- .github/workflows/vale.yml | 51 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5feaaa12a20..7a4bea3bec7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,42 +39,41 @@ jobs: website/**/*.md separator: ' ' - - name: Debugging - Print changed files - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + - name: Filter out deleted files + id: filter-files run: | - echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + # Separate the changed files into deleted and non-deleted + CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + DELETED_FILES="${{ steps.changed-files.outputs.deleted_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 + # Filter out the deleted files + FILES_TO_LINT="" + for file in $CHANGED_FILES; do + if [[ ! " $DELETED_FILES " =~ " $file " ]]; then + FILES_TO_LINT+="$file " fi done - - name: Run vale + # Trim trailing whitespace and set the output + FILES_TO_LINT=$(echo "$FILES_TO_LINT" | xargs) + echo "files_to_lint=$FILES_TO_LINT" >> $GITHUB_OUTPUT + + - name: Debugging - Print files to lint if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Files to lint:" + echo "${{ steps.filter-files.outputs.files_to_lint }}" + + - name: Run Vale + if: ${{ steps.filter-files.outputs.files_to_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 }} + files: ${{ steps.filter-files.outputs.files_to_lint }} separator: ' ' version: '2.27.0' -# - 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 }} + - name: Skip Vale linting + if: ${{ steps.filter-files.outputs.files_to_lint == '' }} + run: echo "No files to lint, skipping Vale." From 6fe4feae591743f1e19901e2fe444782795cf0d7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 18 Oct 2024 15:16:10 +0100 Subject: [PATCH 2/2] add --- styles/custom/Repitition.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..d6502f2b3ee 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -3,4 +3,4 @@ message: "'%s' is repeated!" level: warning alpha: true tokens: - - '[^\s]+' + - '\b(\w+)\b'