From 327bd0936cfe8be332db20438325d7eb8203412e Mon Sep 17 00:00:00 2001 From: kodster28 Date: Fri, 23 Aug 2024 11:52:40 -0500 Subject: [PATCH] Will vale find this? --- .github/workflows/vale.yml | 37 +++++++++++++++++++++++++++++++++++++ .vale.ini | 3 --- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/vale.yml diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml new file mode 100644 index 00000000000000..0b310962a8cbb4 --- /dev/null +++ b/.github/workflows/vale.yml @@ -0,0 +1,37 @@ +name: Style guide +on: + pull_request: + types: + - opened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + review: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Get Changed Files from Pull Request + if: ${{ !cancelled() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # get file names and structure as JSON + files=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files -q '.[] | select(.status != "removed") | .filename | select(test("(.yaml|yml|md)$"))') + filesArray="[$(echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/ /", "/g' | tr '\n' , | sed 's/,$//')]" + echo "CHANGED_FILES=$filesArray" >> "$GITHUB_ENV" + - name: Output Changed Files + run: echo ${{ env.CHANGED_FILES }} + + - name: Vale + uses: errata-ai/vale-action@reviewdog + if: ${{ !cancelled() }} + with: + files: ${{ env.CHANGED_FILES }} + reporter: github-pr-review + filter_mode: diff_context diff --git a/.vale.ini b/.vale.ini index 493155a5ce343a..f791bb414921b5 100644 --- a/.vale.ini +++ b/.vale.ini @@ -14,8 +14,5 @@ TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\ [*.md] BasedOnStyles = cloudflare -[*.mdx] -BasedOnStyles = cloudflare - [*.yaml] BasedOnStyles = cloudflare \ No newline at end of file