DEV Community

Kaustav Basak
Kaustav Basak

Posted on

Catch SEO mistakes in CI with a free GitHub Action

We kept seeing the same story in SEO audits: a site loses most of its Google traffic, and the cause is a single line, <meta name="robots" content="noindex">, left over from a staging environment and shipped to production. Nobody notices for weeks, because the site looks fine to people. Only search engines are being told to go away.

That kind of mistake is easy to catch in CI, so we built a small GitHub Action for it: SEO Check.

What it fails the build on

  • an accidental noindex (meta tag or X-Robots-Tag header)
  • a missing or empty <title>
  • broken internal links
  • a robots.txt that blocks every crawler from the whole site

It also warns about titles too wide for Google, missing meta descriptions and H1s, canonical tags that contradict a noindex, images without alt, and a missing viewport tag. The rules are deliberately conservative: each one flags something that is almost always a mistake, so the build doesn't cry wolf.

Two ways to run it

On your build output (static sites; no network needed):

- run: npm ci && npm run build
- uses: seoaiaudits/seo-check-action@v1
  with:
    path: out
Enter fullscreen mode Exit fullscreen mode

Or against a live URL (a preview deploy or production), with a small same-site crawl:

- uses: seoaiaudits/seo-check-action@v1
  with:
    start-url: https://example.com/
    max-pages: 100
Enter fullscreen mode Exit fullscreen mode

Findings show up as annotations on the pull request and as a table in the job summary.

The detail we like most: title width

Most SEO tools warn when a title is "over 60 characters". Google doesn't cut titles by characters, though. It cuts them by width, at roughly 600px of 20px Arial on desktop. Forty capital Ws overflow; seventy lowercase i's fit. So the action adds up the standard Arial character widths and warns on pixels, which matches what searchers actually see.

What it isn't

It doesn't render JavaScript, score content, or replace a full audit. It's a guard rail for the mistakes worth failing a build over. (If you want the full picture, we also run a free web-based audit at seoaiaudits.com)

It's MIT-licensed, around 400 lines of Python with one dependency (BeautifulSoup), and the tests run the action against a small site with mistakes planted on purpose. Issues and pull requests are very welcome: https://github.com/seoaiaudits/seo-check-action

Top comments (0)