Skip to content

CI and dependency updates ​

CI runs from .github/workflows/. These rules apply to every workflow in that directory, including future release or publish workflows. They are enforced by tests/integration/ci-workflow-policy.test.ts.

Pinned actions ​

Every uses: reference is pinned to a full 40-character commit SHA with the exact release in a trailing comment:

yaml
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

Tags such as @v4 can be moved by whoever controls the action repository; a commit SHA cannot. When adding or bumping an action by hand:

  1. Resolve the SHA from the upstream repository, for example git ls-remote --tags https://github.com/actions/checkout 'refs/tags/v4*'. For an annotated tag, use the peeled ^{} commit, not the tag object.
  2. Use the exact release the major tag points to (v4 → v4.4.0), and write that release in the comment.
  3. Use one SHA per action repository across all workflows. CodeQL init and analyze must come from the same github/codeql-action release.

Never copy a SHA from a blog post or another repository without checking it against upstream.

Container images are pinned by exact tag. The Playwright image tag must match @playwright/test in package.json; it also provides the browsers (Chromium, Firefox, and WebKit with their system libraries). On Playwright 1.65.1, browser-cross installs Firefox revision 1575 for the upstream accessibility fix. The version-specific pnpm patch selects the same browser for local pnpm exec playwright install firefox. Remove the patch and CI install step when the pinned image includes the fix. The browser-shard matrix (3 Chromium shards) runs the Chromium projects and the consolidated browser-cross job runs both firefox-e2e and webkit-e2e from the same image; see the cross-browser matrix.

Token permissions ​

The default GITHUB_TOKEN is read-only (contents: read, or {} at workflow level). Grant extra scopes per job, only where needed, with a comment explaining why. Keep write scopes off jobs that run pull-request code; the exception is CodeQL's security-events: write, which only uploads scan results. GitHub downgrades the token to read-only for pull requests from forks. A future release workflow follows the same rules: pinned SHAs, job-level scopes such as id-token: write for provenance only on the publish job, and no publish steps triggered by untrusted events. See releases.

Install scripts ​

pnpm install --frozen-lockfile runs with dependency install scripts blocked except those listed under allowBuilds in pnpm-workspace.yaml. Adding an entry needs the review described in the dependency policy.

Node versions ​

engines.node is >=22. The verify-static, verify-unit (with coverage), verify-integration, verify-build, build-browser-hosts, nuxt-fixture, browser-shard, and browser-cross jobs run on Node 22. Node 24 compatibility is exercised without duplicate coverage instrumentation by verify-unit-node24 on pushes to master, merge groups, weekly scheduled runs, and pull requests that change Node/tooling configuration (package.json, pnpm-lock.yaml, pnpm-workspace.yaml, vitest.config.ts, or .github/workflows/ci.yml). Raising the engines floor needs its own reviewed change.

Guarded paths ​

The Guarded paths workflow fails a pull request that changes the files other checks depend on, until the PR carries an approval label for each tier it touches. The path list and labels live in scripts/lib/guarded-paths-check.js.

TierPathsAccepted label
Maintainer.github/, AGENTS.md, CLAUDE.md, docs/agents/, the component gate, and the scripts that implement checks, release and baselinesguarded-change-approved
Second reviewscripts/bundle-size-budgets.json and Playwright snapshot directoriessecond-review-approved or guarded-change-approved

Only a maintainer applies guarded-change-approved. A reviewer other than the PR's author applies second-review-approved after checking the posted budget report or screenshots. The label stays on later pushes, so re-check the diff before merging if guarded files changed after approval.

A helper module that a maintainer-tier script imports, directly or through another helper, is in the maintainer tier too, along with its .d.ts.

The workflow runs on pull_request_target: GitHub takes the workflow file and the checked-out scripts from the base branch, and the job reads the PR's changed files and labels from the API without checking out PR code. A PR is therefore judged by the rules already merged, and can't edit the step that judges it. The repository's Actions policy must allow pull_request_target for .github/workflows/guarded-paths.yml.

Path-scoped checks and caching ​

The changes job classifies pull request diffs via scripts/ci-changed-paths.mjs:

  • Prose-only docs (docs/**/*.md without live Vue/VitePress blocks or <!-- @generated docs-api:… --> tables), AGENTS.md, and CLAUDE.md PRs set skip_heavy=true while keeping required verify and browser checks green. Pages with generated API tables still run verify-static, whose pnpm docs:api step checks those tables. Component spec frontmatter (docs/components/*-spec.md) is copied into generated manifests, but a spec-only PR can still skip verify-static. Run pnpm manifests locally for those edits. #590 changed only spec approval evidence, skipped heavy jobs, and left stale manifests for #606 to regenerate.
  • Docs, showcase, and example PRs (e2e_scope=docs) scope browser-shard to docs-*.spec.ts, examples*.spec.ts, and any other spec that opens a docs page (it uses the docsUrl fixture or serves apps/docs/.vitepress/dist), and skip unrelated nuxt-fixture, browser-cross, and verify-unit-node24 jobs (verify-static still runs pnpm keyboard-evidence in list mode).
  • tests/integration/new-component.test.ts runs targeted verification over scaffolded artifacts by default; setting RUN_FULL_SCAFFOLD_VERIFY=1 (used on scaffolding changes and the weekly CI schedule) runs full nested pnpm verify.
  • verify-static caches .prettiercache (static-prettier-cache) and build-browser-hosts caches apps/docs/.vitepress/cache (vitepress-cache). Both set GHOSTVUE_REGISTRIES_READY=1 after pnpm install (prepare) runs registries:write so pretypecheck and prebuild hooks skip redundant rewrites while pnpm registries verification still executes.

The build-browser-hosts job builds the playground and docs, checks the built site links, and uploads one artifact for every browser runner. It starts alongside verify-build, which builds the packages and runs the export, packed-consumer, agent guide, bundle-size, and MCP asset checks. Both jobs must pass for verify to succeed on heavy runs. The browser check waits for the hosts and the selected browser jobs.

Docs deployment ​

The ghost-vue-docs project serves ghostvue.dev on Vercel. GitHub Actions builds the docs from the exact verified npm release commit on master and uploads a prebuilt deployment. The staged deployment must pass clean URL, redirect, and llms.txt checks before the workflow moves the production domains. It promotes through the Vercel REST API rather than vercel promote, and the job passes only once ghostvue.dev serves the promoted deployment. Maintenance releases use their own npm tag and leave the main docs site on latest.

In GitHub Actions, use Deploy GhostVue docs → Run workflow on master.

  • verify stages the docs for npm latest and checks them without assigning the production domains.
  • publish-latest publishes the docs for npm latest, including after a failed release deployment.
  • publish-master publishes the selected master commit. Use it for a docs-only correction or when you explicitly want the site to show unreleased work.

The workflow reads VERCEL_TOKEN from the docs-production environment, which allows deployments from master. The release workflow names VERCEL_TOKEN in its reusable workflow call so the deploy job can resolve the environment secret. After the first verify run passes, set the Vercel project's Ignored Build Step to exit 0 and set the repository Actions variable VERCEL_DOCS_RELEASE_DEPLOY to true to enable release publishing.

The docs build loads Vercel Web Analytics when VERCEL_ENV=production. Enable Web Analytics on that project before deploying. After deployment, visit a docs page and follow an internal link. Check for one /_vercel/insights/view request per page and confirm both paths appear in the Analytics dashboard. See the Vercel Web Analytics quickstart.

Browser shard balancing ​

Playwright's --shard splits tests by count, but the cheap chromium screenshot tests and the heavy docs and example specs cost very different amounts, so equal counts left one shard doing most of the work. Each browser-shard job instead runs scripts/e2e-shard-plan.mjs, which lists the selected tests, groups them into project/spec-file units, costs each unit from the mean per-test durations in scripts/e2e-shard-timings.json, and packs the units onto the three shards heaviest first. The job then runs its share with playwright test --test-list. Every job computes the same plan, so the shards never overlap or drop a test. A spec file missing from the timing table is costed at its project's median, so new specs only make the balance slightly worse until the table is refreshed.

Refresh the table when a shard's runtime drifts well away from the others: download the playwright-results-json artifact from a recent full master run and run node scripts/e2e-shard-plan.mjs --write-timings=<path/to/results.json>. Only relative durations matter, so a local full Chromium run also works.

Keyboard evidence ​

The browser job merges every Playwright blob report into HTML, GitHub annotations, and .artifacts/playwright/results.json, and on full E2E runs (e2e_scope != 'docs') runs node scripts/check-keyboard-evidence.mjs --report on that JSON. It fails when any test mapped in a manifest's accessibility.verification.automatedKeyboard did not execute in chromium-e2e or did not pass. See accessibility verification.

Playwright retry summary ​

The browser job uses the merged Playwright results to list tests that passed on retry in the Actions run summary, including the project, spec location, full test title, and successful retry number. When the summary lists a retry pass, download the playwright-report artifact, open its HTML report, and select the retry to view its trace when available.

Nuxt SSR fixture ​

The nuxt-fixture job builds apps/nuxt-fixture (the @ghostvue/nuxt consumer) in its headless default and themed opt-in variants and runs pnpm test:nuxt in the same pinned Playwright image as browser-shard. It runs on master, merge groups, weekly runs, and PRs touching workspace packages, Nuxt fixture/config, scripts/, or CI configuration; when run, the aggregate verify check requires it. Run it locally after building the packages: pnpm --filter "@ghostvue/nuxt-fixture^..." build && pnpm test:nuxt.

Security scanning ​

.github/workflows/codeql.yml runs CodeQL for javascript-typescript and actions. It runs on pushes and pull requests to master when code, package, or workflow files change, plus an unfiltered weekly schedule. Results appear under the repository's code scanning alerts.

Automated dependency updates ​

Dependabot (.github/dependabot.yml) opens update pull requests on Monday mornings (UTC) for npm and github-actions:

  • npm versions stay exact (versioning-strategy: increase alongside saveExact in pnpm-workspace.yaml). Installs keep strictPeerDependencies and engineStrict; Dependabot does not override them.
  • A new npm release must be at least 3 days old before Dependabot proposes it (cooldown.default-days: 3), which gives the registry time to pull a bad or compromised version. Dependabot security updates continue immediately without delay.
  • Dependabot security updates only work for direct dependencies. For a transitive one, its updater runs pnpm update <pkg>@<version> -r, which pnpm 11 does not apply below the top level, so the run fails with security_update_not_possible and opens no pull request, even when the fix is inside the parent's range. .github/workflows/security-lockfile-refresh.yml covers this: every Monday after Dependabot it re-resolves each package pnpm audit flags inside its parents' ranges (scripts/security-lockfile-refresh.mjs) and opens or updates one deps/security-lockfile-refresh pull request when that clears an advisory. It can also be run by hand from the Actions tab. It needs DEPENDENCY_REFRESH_TOKEN (contents and pull requests write on this repository) in the dependency-refresh environment, limited to master, because pull requests opened with GITHUB_TOKEN do not start CI.
  • GitHub Actions are grouped into one github-actions pull request and Dependabot preserves the full 40-character commit SHA pins and version comments enforced by tests/integration/ci-workflow-policy.test.ts.
  • Playwright packages (@playwright/test, playwright, and playwright-core) are grouped into one playwright pull request. Dependabot does not rewrite container image tags in .github/workflows/ci.yml, scripts/lib/test-visual-docker.js, or .cursor/environment.json. When a Playwright PR updates @playwright/test, update the pinned mcr.microsoft.com/playwright tag in those files to match (enforced in CI by tests/integration/ci-workflow-policy.test.ts).
  • Major updates for node, @types/node, and pnpm are ignored in .github/dependabot.yml so runtime floor bumps remain explicit human pull requests.
  • The hourly PR sweep may merge routine upgrades to existing dependencies after reviewing the upstream changes and verifying the required checks. Major-version upgrades and updates with severe breaking changes require explicit admin approval. The sweep reports the affected version and the concrete impact, such as a raised runtime floor or a removed API GhostVue uses. Mechanical updates to matching version pins follow the same dependency rule. Changes to workflow behavior or permissions require admin approval.

Security advisories are triaged as described in the dependency policy.