Release gate

One pull request check for SEO, links and more, with settings that live in your repository.

The release gate grows the SEO check into one check with rule packs. Each pack compares the preview of a pull request with production, and reports only the problems that the pull request adds.

Rule packs

PackWhat it checksDefault
seoThe SEO rules of the SEO check.On
accessibilityNew accessibility violations that axe-core finds, on up to 10 pages.Off
linksBroken new links, mixed content, heavy new images and page weight growth.Off
securityHeadersSecurity response headers that the preview drops or weakens.Off

Turn packs on in Project settings > SEO checks, or in relay-gate.json. The file wins.

Accessibility

The accessibility pack runs axe-core 4.13.0 on production and on the preview, for up to 10 checked pages in each run.

  • A violation is new when the preview has an element that production does not, for a rule that fails on more elements on the preview than on production. The second part keeps a class name that changed between builds from looking new.
  • New serious and critical violations block. New moderate ones warn. minor ones are not reported.
  • The browser time is billed like rendered audit pages. Without room in your credits or spending limits, the run checks no page for accessibility and says so.
  • A protected preview cannot be loaded in the browser with its access header, so the run says that accessibility was not checked.

Automated checks find only some accessibility issues. Manual testing with assistive technology is still needed.

RuleSeverity
A link that is new on the preview returns 4xx or 5xxBlocking
A new http: subresource on an https: page (mixed content)Blocking
A new image over imageMaxKb (300 KB by default)Warning
The page's transfer size grows by 25% or moreWarning

Without this pack, the SEO check still reports a broken new link as a warning. Relay reads each image, script and stylesheet size with one request, at most 200 for each run. It compares a page's weight only when it knows every size on both versions, so a skipped request cannot look like growth. This pack does not read console errors.

Security headers

The security pack compares these response headers on production and the preview: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and protection against framing (X-Frame-Options, or frame-ancestors in the CSP).

  • A header that production sends and the preview drops blocks on a preview on your own domain. On a platform preview host, such as *.vercel.app or *.pages.dev, it is a warning, because platforms set some headers themselves.
  • A weaker value is a warning: a shorter HSTS max-age, or 'unsafe-inline' added to script-src.

Headers are usually the same on every page, so the summary shows each change once, on the first page that has it. This pack checks headers only. It is not a security scan.

relay-gate.json

Put relay-gate.json at the root of the repository:

{
  "packs": {
    "seo": true,
    "links": true
  },
  "ignore": [{ "rule": "title-changed", "path": "^/legacy/" }]
}
  • packs: turn a pack on with true or off with false. A pack that the file does not name uses the project setting.
  • ignore: each entry skips one rule on the paths that match path, a regular expression. The check summary lists these entries, so every reviewer sees them.
  • budgets: limits for later packs. The file accepts lcpWorsePercent, tbtWorsePercent, clsWorsePercent, jsGrowthPercent and imageMaxKb.

Relay validates the file. If it is not valid, the check fails with the exact reason, for example relay-gate.json is invalid: packs.links: Invalid input: expected boolean, received string.

With the GitHub App, Relay reads relay-gate.json from the commit that it checks. The GitHub Action sends the file from version v2 (PlaybookMediaLLC/relay-seo-check@v2); set another path with its config-path input. v1 does not send it, so for v1 runs, set the packs in Project settings.

Results

The check summary groups the findings by pack. Each run stores the hash of the file it used and the packs it ran, so you can see which settings gave a result. Below the findings, a one-line chart shows the blocking findings of the repository's last 10 finished runs, oldest first.

On this page