Skip to content

Commit e885a42

Browse files
committed
add
1 parent 1f3c52e commit e885a42

File tree

2 files changed

+36
-45
lines changed

2 files changed

+36
-45
lines changed

.github/workflows/vale.yml

+35-43
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,44 @@
1-
name: Lint and suggest
1+
name: Lint Markdown Files
22

33
on:
44
pull_request:
55
paths:
66
- '**/*.md'
77

8-
permissions:
9-
contents: read
10-
pull-requests: write
11-
128
jobs:
13-
vale: # Vale linting job
9+
vale:
10+
name: Vale Markdown Lint
1411
runs-on: ubuntu-latest
15-
1612
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0 # Fetch all history so we can access all commits
21-
22-
- name: Install Vale
23-
uses: errata-ai/vale-action@v2
24-
with:
25-
version: 2.17.0
26-
files: all
27-
reporter: github-pr-check
28-
29-
- name: Install jq
30-
run: sudo apt-get install -y jq
31-
32-
- name: Get changed files
33-
id: changed-files
34-
run: |
35-
BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
36-
CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md')
37-
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
38-
echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV
39-
40-
- name: Print Changed Files
41-
run: echo $CHANGED_FILES
42-
43-
- name: Run Vale on changed files
44-
run: |
45-
for file in ${{ env.CHANGED_FILES }}; do
46-
echo "Running Vale on $file"
47-
vale --output=JSON $file > "vale_output_${file//\//_}.json"
48-
vale --output=edit $file > "vale_output_${file//\//_}_edit.md"
49-
done
50-
echo "Vale outputs:"
51-
ls -l
52-
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Install Vale
17+
uses: errata-ai/vale-action@v2
18+
with:
19+
version: 2.17.0
20+
files: all
21+
reporter: github-pr-check
22+
fail_on_error: true
23+
24+
- name: Run Vale on changed files
25+
run: |
26+
BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
27+
CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md')
28+
for file in $CHANGED_FILES; do
29+
echo "Running Vale on $file"
30+
vale --output=JSON $file > "vale_output_${file//\//_}.json"
31+
vale --output=edit $file > "vale_output_${file//\//_}_edit.md"
32+
done
33+
34+
- name: Upload Vale results
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: vale-results
38+
path: . # Uploads current directory by default
39+
40+
- name: Vale Check Summary
41+
run: echo "Vale check completed successfully."
42+
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}

.vale.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ StylesPath = styles
22
MinAlertLevel = suggestion
33

44
[*.md]
5-
BasedOnStyles = custom
6-
BasedOnStyles = Vale.Spelling
5+
BasedOnStyles = custom, Vale.Spelling
76

87
Vocab = EN

0 commit comments

Comments
 (0)