-
Notifications
You must be signed in to change notification settings - Fork 29
43 lines (34 loc) · 1.4 KB
/
docs-content-check.yaml
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
name: Documentation content check
# The `vale` GitHub action does not work on PR events so this is triggered on all pushes.
on: [pull_request]
jobs:
writing_style:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download .vale.ini and style rules from @commercetools-docs/writing-style
run: |
package_version=$(node -e "console.log(require('./package.json').dependencies['$PACKAGE_NAME'])")
echo "Removing package.json and pnpm-lock.yaml to avoid installation issues"
rm package.json pnpm-lock.yaml
echo "Installing $PACKAGE_NAME@$package_version"
npm install --no-save "$PACKAGE_NAME@$package_version"
env:
PACKAGE_NAME: '@commercetools-docs/writing-style'
- name: Check content (generates GitHub comments via `reviewdog`)
uses: errata-ai/vale-action@reviewdog
with:
version: 2.18.0
files: '["website-custom-views/src"]'
reporter: github-pr-review
filter_mode: diff_context
fail_on_error: true
vale_flags: '--config=node_modules/@commercetools-docs/writing-style/.vale.ini'
token: ${{ secrets.GITHUB_TOKEN }}
debug: true