From 4d7d1f9999723076ccc5899f91dcb5c32d31751c Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Fri, 15 Jul 2022 12:56:08 +0200 Subject: [PATCH] ci: add separate workflow for content check, with reviewdog support (#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 --- .github/workflows/docs-content-check.yaml | 43 +++++++++++++++++++++++ .github/workflows/main.yml | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs-content-check.yaml diff --git a/.github/workflows/docs-content-check.yaml b/.github/workflows/docs-content-check.yaml new file mode 100644 index 0000000000..80461c8bb6 --- /dev/null +++ b/.github/workflows/docs-content-check.yaml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d986172674..c24e859f65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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