-
Notifications
You must be signed in to change notification settings - Fork 969
79 lines (69 loc) · 2.41 KB
/
vale.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Vale linting
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'website/docs/**/*'
- 'website/blog/**/*'
- 'website/**/*'
jobs:
vale:
name: Vale linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: List repository contents
run: |
pwd
ls -R
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Vale
run: pip install vale==3.9.1.0 # Install a stable version of Vale
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
website/**/*.md
separator: ' '
- name: Debugging - Print changed files
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_and_modified_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
fi
done
- name: Run vale
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
uses: errata-ai/vale-action@reviewdog
with:
token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
separator: ' '
# - 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 }}