Skip to content

Commit

Permalink
Combine docs format and prose lint jobs
Browse files Browse the repository at this point in the history
Run the prose linter on the teleport directory we already prepared.
  • Loading branch information
ptgott committed Oct 22, 2024
1 parent 8a665d9 commit 73f85f3
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/doc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ jobs:
doc-tests:
name: Lint (Docs)
needs: changes
if: ${{ !startsWith(github.head_ref, 'dependabot/') && needs.changes.outputs.changed == 'true' }}
if: ${{ !startsWith(github.head_ref, 'dependabot/') && needs.changes.outputs.changed == 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: read

steps:
- name: Checkout
Expand Down Expand Up @@ -87,28 +88,15 @@ jobs:
yarn build-node
- name: Check spelling
run: cd $GITHUB_WORKSPACE/docs && yarn spellcheck content/teleport
working-directory: "$GITHUB_WORKSPACE/docs"
run: yarn spellcheck content/teleport

- name: Lint the docs
run: cd $GITHUB_WORKSPACE/docs && yarn markdown-lint

- name: Test the docs build
run: cd $GITHUB_WORKSPACE/docs && yarn install && yarn build
- name: Lint docs formatting
working-directory: "$GITHUB_WORKSPACE/docs"
run: yarn markdown-lint

stylecheck:
name: Lint docs prose style
runs-on: ubuntu-latest
needs: changes
if: ${{ !startsWith(github.head_ref, 'dependabot/') && needs.changes.outputs.changed == 'true' && github.event_name == 'pull_request' }}
permissions:
pull-requests: read
steps:
- name: Check out the teleport repo
uses: actions/checkout@v4
with:
repository: "gravitational/teleport"

- name: Run the linter
- name: Lint docs prose
working-directory: "$GITHUB_WORKSPACE/docs/content/teleport"
uses: errata-ai/vale-action@38bf078c328061f59879b347ca344a718a736018 # v2.1.0
with:
version: 3.8.0
Expand All @@ -122,3 +110,7 @@ jobs:
fail_on_error: true
vale_flags: "--config=docs/.vale.ini"

- name: Test the docs build
working-directory: "$GITHUB_WORKSPACE/docs"
run: yarn install && yarn build

0 comments on commit 73f85f3

Please sign in to comment.