mirror of
https://github.com/netbirdio/docs.git
synced 2026-08-27 18:21:27 +02:00
ci: validate PRs with build and MDX heading linter (#743)
* ci: validate PRs with build and MDX heading linter Adds a pull_request workflow running npm run lint:mdx, npm run build, and npm run lint so heading-hierarchy bugs and broken builds get caught before merge rather than after. The new linter (scripts/lint-mdx-headings.mjs) enforces that the first heading is h1 and that heading levels never jump by more than one. Also fixes three existing pages that had no h1 title — two were using a legacy export const title pattern, one was missing a title entirely. * ci: use npm install since lockfile is gitignored package-lock.json is in .gitignore, so npm ci and setup-node's npm cache both fail on a fresh CI checkout. Match the Dockerfile pattern (npm install, no cache) instead. * ci: drop ESLint step; project config is broken `npm run lint` fails with 'Converting circular structure to JSON' under ESLint 9.x — the repo has no .eslintrc or eslint.config file, so the legacy resolver hits the React plugin's circular reference. This is pre-existing (build_n_push.yml never ran lint, so it stayed hidden); fixing it needs flat-config migration and is out of scope. Drop the step until that lands.
This commit is contained in:
33
.github/workflows/pr-build.yml
vendored
Normal file
33
.github/workflows/pr-build.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: pr-build
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.actor_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: lint and build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Lint MDX heading hierarchy
|
||||
run: npm run lint:mdx
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
Reference in New Issue
Block a user