Validate every pull request
Run opend validate in GitHub Actions so problems show inline on the pull
request, before anything is merged or published.
About this task
The starter template ships .github/workflows/validate.yml, which runs the
published CLI with npx @opend/cli@0. Until the CLI is published to npm, build it from
a checkout of the OpenD repository instead, as this workflow does.
-
Add a workflow to the docs repository.
name: Validate docs on: pull_request: push: branches: [main, 'v*'] jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: path: docs - uses: actions/checkout@v4 with: repository: desktopmachineshop/opend path: opend - uses: pnpm/action-setup@v4 with: package_json_file: opend/package.json - uses: actions/setup-node@v4 with: node-version: 22 - run: pnpm install --frozen-lockfile && pnpm build working-directory: opend - run: node opend/packages/cli/dist/bin.js validate docs --format github -
Optional: add
--strictto fail on warnings too.This site's own CI validates
site/with--strict.
Results
With --format github, each problem becomes a workflow annotation on the line it
is about, titled with its code.
On the hosted platform the worker runs the same validation on every push, and a failing push never goes live. CI tells authors earlier.