Skip to content

Commit

Permalink
ci: add separate workflow for content check, with reviewdog support (#…
Browse files Browse the repository at this point in the history
…2714)

* ci: add separate workflow for content check, with reviewdog support

* ci(content-check): improve step setup

* docs: add style error on purpose to test the ci action

* docs: revert testing change
  • Loading branch information
emmenko authored Jul 15, 2022
1 parent d0618b0 commit 4d7d1f9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/docs-content-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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@v3

- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v3
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 yarn.lock to avoid installation issues"
rm package.json yarn.lock
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: '["website"]'
reporter: github-pr-review
filter_mode: diff_context
fail_on_error: true
vale_flags: '--config=node_modules/@commercetools-docs/writing-style/.vale.ini'
debug: true
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: yarn typecheck:starter

- name: Running linters and tests
run: yarn jest --projects jest.{eslint,stylelint,test,text}.config.js --reporters jest-silent-reporter
run: yarn jest --projects jest.{eslint,stylelint,test}.config.js --reporters jest-silent-reporter
env:
CI: true
RTL_ASYNC_UTIL_TIMEOUT: 5000
Expand Down

1 comment on commit 4d7d1f9

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for merchant-center-application-kit ready!

✅ Preview
https://merchant-center-application-2a3ua0u1c-commercetools.vercel.app

Built with commit 4d7d1f9.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.