Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GHA job for linting docs prose (#35792)
* Add a GHA job for linting docs prose This change helps ensure that the documentation uses consistent product language and style without requiring manual intervention by members of the Documentation Team. To do so, it introduces automated linting using the Vale prose linting tool. It includes one style rule--making sure docs pages say "MFA" instead of "2FA"--as a proof of concept. The main advantages of Vale are that: - Vale includes logic for parsing Markdown and running linters out of the box. - Vale has a flexible configuration language that makes style rules easy to define. This is in contrast to the linters we wrote in `gravitational/docs`, where logic for traversing Markdown ASTs is tightly coupled with the definition of style rules, making these linters difficult to extend. Because the point of using Vale is to make it easy to define comprehensive style rules, the GitHub Actions job that runs Vale only runs it against files changed by a PR. This means that, when we introduce a new style rule, we won't need to rectify all violations in the docs before allowing authors to merge their changes. Note that the GHA config introduces a separate job for Vale. This is because the `errata-ai/vale-action` action does not allow the configuration to set a working directory, and the `Lint (Docs)` job organizes the `teleport` repo into a `gravitational/docs` submodule, making the Vale action incompatible with the `Lint (Docs)` job. Also note that we cannot reuse the `changed_files` output of the `Check for relevant changes` step between the Vale job and the `Lint (Docs)` job without adding some complexity, since the Vale job doesn't accept a space as a delimiter for file paths, and `remark` doesn't accept non-spaces. While we could look into checking only changed files in `Lint (Docs)` in the future, this change refrains from doing so to keep things simple. * Respond to zmb3 feedback - Remove the `merge_group` trigger since this job runs on PRs anyway. - Only run the docs prose linter if relevant files have changed (use the same `if` condition as the `doc-tests` job). * Respond to rosstimothy feedback Remove quotes around a config key * Run Lint (Docs) on merge_group However, ensure that the prose linter only runs on pull_request to prevent unnecessary work.
- Loading branch information