From 1f3634b9fb05f98888a33204fd8e84221cf040ee Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:47:35 +0100 Subject: [PATCH 1/2] add --- .github/workflows/vale.yml | 40 ++++++++++++++++++++------------------ styles/custom/Spelling.yml | 16 +++++++++++++++ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9b3553cade0..6782de30ef3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,24 +21,26 @@ jobs: reporter: github-pr-check fail_on_error: true + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + - name: Run Vale on changed files run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - for file in $CHANGED_FILES; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: . # Uploads current directory by default - - - name: Vale Check Summary - run: echo "Vale check completed successfully." - - env: - GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index e69de29bb2d..edafa517926 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -0,0 +1,16 @@ +extends: spelling + +message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." +level: warning + +path: styles/custom/your-dictionary.dic + +--- + +extends: existence + +message: "Ignore specific patterns" +level: skip +tokens: + - '\bdbt\s+Cloud\b' + - '\bdbt\s+.*?\b' From e404ef582a9cfc3833b0c6a922e0ea1f86f0bf97 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:47:46 +0100 Subject: [PATCH 2/2] add --- styles/custom/Spelling.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index edafa517926..e69de29bb2d 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -1,16 +0,0 @@ -extends: spelling - -message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." -level: warning - -path: styles/custom/your-dictionary.dic - ---- - -extends: existence - -message: "Ignore specific patterns" -level: skip -tokens: - - '\bdbt\s+Cloud\b' - - '\bdbt\s+.*?\b'