Skip to content

Commit

Permalink
Will vale find this?
Browse files Browse the repository at this point in the history
  • Loading branch information
kodster28 committed Aug 23, 2024
1 parent 733728e commit 327bd09
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\
[*.md]
BasedOnStyles = cloudflare

[*.mdx]
BasedOnStyles = cloudflare

[*.yaml]
BasedOnStyles = cloudflare

0 comments on commit 327bd09

Please sign in to comment.