docs-pr-check — CI gate for documentation hygiene on pull requests
Generates a GitHub Actions workflow that runs on every pull request and enforces three documentation quality checks: code-to-docs change ratio, frontmatter validity, and internal link integrity.
Workflow#
- Receive configuration — accept the
block_on_broken_linksflag (defaultfalse) that controls whether broken links fail the build or are reported as warnings only. - Render the workflow file — produce a GitHub Actions workflow configured with the supplied settings. The workflow triggers on
pull_requestand runs three jobs. - Write to the repository — place the workflow at
.github/workflows/docsbook-docs-check.yml, creating the directory if it does not exist. Overwrite if the file already exists. - Report — print the output path, the effective
block_on_broken_linksvalue, and a reminder to commit and open a PR to activate the check.
Guardrails#
- Do not modify any existing workflow files other than
docsbook-docs-check.yml. - The workflow must use
continue-on-error: trueon the broken-links job whenblock_on_broken_linksisfalse; only set it tofalse(blocking) when the flag is explicitlytrue. - Never run the checks against the base branch — only the changed files in the PR diff.
- Frontmatter validation must not fail on missing optional fields; only required fields (
title,description) trigger an error.
Acceptance Criteria#
- Workflow file written to
.github/workflows/docsbook-docs-check.yml -
block_on_broken_linksvalue reflected correctly in the generated workflow - Workflow triggers on
pull_requestevents only - Three check jobs present: code-vs-docs ratio, frontmatter validation, internal links
- Broken-links job uses
continue-on-errorwhenblock_on_broken_linksisfalse - Output message includes file path, flag value, and commit reminder