-
Notifications
You must be signed in to change notification settings - Fork 0
SEO Regression
github-actions[bot] edited this page Jul 13, 2026
·
1 revision
Git-aware SEO regression checks compare production pages with a pull-request preview deployment using explicit file→route mappings.
npm i -D @rankmyseo/cli @rankmyseo/scanner@rankmyseo/scanner is also used by POST /scan for SSRF-safe fetching.
In rankmyseo.config.ts:
regression: {
enabled: true,
productionUrl: "https://www.example.com",
alwaysRoutes: ["/"],
routeMap: [
{ files: ["app/page.tsx", "app/layout.tsx"], routes: ["/"] },
{ files: ["app/about/**"], routes: ["/about"] },
],
failOn: "error", // or "warning"
timeoutMs: 10_000,
maxBytes: 1_500_000,
},CI supplies the preview URL. RankMySEO does not call Vercel/Netlify APIs.
npx rankmyseo-cli regression check \
--candidate-url "$PREVIEW_URL" \
--base-ref "$BASE_SHA" \
--head-ref "$HEAD_SHA" \
--jsonFlags:
| Flag | Meaning |
|---|---|
--candidate-url |
Preview deployment origin (required) |
--base-ref |
Git base (default origin/main) |
--head-ref |
Git head (default HEAD) |
--all-routes |
Scan every mapped route, ignore git diff |
--config |
Config path |
--json |
Machine-readable SeoRegressionResult
|
| Code | Meaning |
|---|---|
0 |
No gated regressions |
1 |
Findings at/above failOn
|
2 |
Config/network/runtime failure (e.g. preview unavailable) |
Only healthy → unhealthy transitions fail:
- Degraded HTTP status
- Unexpected redirect / final URL mismatch
- Newly blocked indexability (
noindex) - Canonical removed or changed
- Title removed
- JSON-LD invalid or types removed
Improvements and pre-existing failures do not fail the gate. Aggregate audit score and Core Web Vitals are not gated.
name: SEO regression
on:
pull_request:
jobs:
seo-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i -D @rankmyseo/cli
# After your preview deploy step sets PREVIEW_URL:
- name: SEO regression check
env:
PREVIEW_URL: ${{ needs.deploy.outputs.url }}
run: |
npx rankmyseo-cli regression check \
--candidate-url "$PREVIEW_URL" \
--base-ref "${{ github.event.pull_request.base.sha }}" \
--head-ref "${{ github.sha }}" \
--jsonIf a PR intentionally removes a title or changes a canonical, either:
- Update the production deployment first, or
- Temporarily set
failOn/ remove the route fromrouteMap, or - Run report-only (capture JSON without failing CI) until the change is accepted.
The scanner:
- Blocks private/localhost targets by default
- Revalidates every redirect hop against an origin allowlist
- Enforces timeouts and response size limits
- Accepts HTML content-types only