A GitHub Action that validates Open Graph and Twitter Card meta tags on your website using the MetaScrape API.
Catch missing or broken social share previews before they go live.
name: Validate OG Tags
on:
push:
branches: [main]
pull_request:
jobs:
og-check:
runs-on: ubuntu-latest
steps:
- uses: shanecode/metascrape-action@v1
with:
api-key: ${{ secrets.METASCRAPE_API_KEY }}
urls: |
https://yoursite.com
https://yoursite.com/blog
https://yoursite.com/pricingMetaScrape offers 100 free requests/month — more than enough for CI validation.
- Sign up at metascrape.shanecode.org/signup
- Copy your
msk_API key - Add it as a repository secret (
METASCRAPE_API_KEY)
| Input | Description | Default |
|---|---|---|
urls |
Newline-separated URLs to validate | required |
api-key |
MetaScrape API key | required |
require-og-title |
Fail if og:title is missing |
true |
require-og-description |
Fail if og:description is missing |
true |
require-og-image |
Fail if og:image is missing |
true |
require-twitter-card |
Fail if twitter:card is missing |
false |
require-favicon |
Fail if favicon is missing | false |
| Output | Description |
|---|---|
passed |
true if all URLs passed validation |
Checking https://yoursite.com
✅ https://yoursite.com — all checks passed
title: Your Site - Build Something Great
og:title: Your Site - Build Something Great
og:desc: The best way to build modern web apps.
og:image: https://yoursite.com/og.png
twitter: summary_large_image
favicon: https://yoursite.com/favicon.ico
Checking https://yoursite.com/blog
⚠️ https://yoursite.com/blog — missing og:image
================================
Results: 1 passed, 1 failed
================================
- Broken social previews = lost clicks when your content is shared
- Missing
og:imagemakes your links look unprofessional on Twitter, Slack, Discord - Easy to accidentally break meta tags during refactors
- Catch issues before they reach production
This action uses the MetaScrape API to extract and validate metadata. MetaScrape handles the actual page fetching, JavaScript rendering, and metadata extraction so you get accurate results.