如何用 Claude Code GitHub Actions 做 SEO/GEO Reviews

用 Claude Code GitHub Actions 和 @claude review prompts,在 metadata、schema、robots、content changes merge 前抓出 SEO/GEO risks。

你會建立什麼

這篇教學會示範如何把 Claude Code GitHub Actions 當成 comment-only SEO/GEO PR reviewer。初學者安全版本不會 rewrite PR。它 review risky changes、留下帶 file references 的 findings,並告訴 human reviewer merge 前該 verify 什麼。

你會建立:

.github/workflows/claude-seo-geo-review.yml
.github/seo-geo-review-prompt.md
CLAUDE.md additions for PR review
seo-geo/pr-review/checklist.md

Claude Code GitHub Actions 做 SEO/GEO PR review:path filters、findings、verification

圖說:第一版保持 comment-only:不 push commits、不 publish、不 submit URLs。

用在會碰 metadata、schema、page templates、internal links、robots、sitemaps、canonical logic、redirects、analytics、docs 或 large content batches 的 pull requests。

步驟 1:決定哪些 PRs 需要 review

先從 path filters 開始。不要對每個 tiny dependency 或 styling PR 都跑 AI review。

PR file pattern

為什麼重要

src/lib/seo.*

Titles、descriptions、canonical URLs、robots tags

src/components/Schema

Structured data 和 rich-result eligibility

robots.txt, sitemap*

Crawl 和 indexing access

middleware., routes/

Redirects、localization、route behavior

src/pages/, app/, content/**

頁面內容和答案抽取

i18n/, locales/

hreflang 和 translated metadata

analytics/, gtm/

Measurement integrity

建立 checklist file:

mkdir -p .github seo-geo/pr-review
cat > seo-geo/pr-review/checklist.md <<'EOF2'
# SEO/GEO PR Review Checklist

Review risks:
- title, meta description, canonical, robots, noindex
- sitemap, redirects, route generation, localization
- schema and JSON-LD validity
- internal links and navigation changes
- answer extraction: concise answer, evidence, FAQ, tables
- unsupported claims, invented proof, outdated stats
- analytics and conversion tracking changes
- build, lint, tests, or preview validation

Review output:
- severity: blocking / important / note
- file reference
- risk
- why it matters for SEO/GEO
- verification step
EOF2

步驟 2:把 review prompt 寫成 file

Prompt 放在 file 裡,之後更容易改善。

cat > .github/seo-geo-review-prompt.md <<'EOF2'
Review this pull request for SEO and GEO risk.

Act as a conservative reviewer. Do not rewrite the PR unless explicitly asked.

Focus on:
- title, meta description, canonical, robots, noindex
- sitemap generation, redirects, route changes, localization, hreflang
- schema / JSON-LD validity and unsupported claims
- internal links, navigation, breadcrumbs, related content
- content that is too generic for AI answer extraction
- missing evidence, screenshots, examples, or citations
- analytics / GTM / GA4 changes
- build, lint, test, preview, and crawl validation gaps

Return findings in this format:

## Blocking
- `file`: risk, why it matters, exact verification step

## Important
- `file`: risk, why it matters, exact verification step

## Notes
- `file`: smaller improvement or follow-up

If there are no findings, say that explicitly and list residual risks.
EOF2

步驟 3:請 Claude Code 產生 current workflow

Claude Code GitHub Actions setup 可能依 current action package、GitHub app setup、repository permissions 和 secrets 而不同。不要 silent guessing,請 Claude Code 依 repo 產生 workflow:

Help me set up Claude Code GitHub Actions for comment-only SEO/GEO PR review.

Use:
- `.github/seo-geo-review-prompt.md`
- `seo-geo/pr-review/checklist.md`

Requirements:
- Trigger only on pull requests that touch SEO/GEO-relevant paths.
- Comment findings on the PR.
- Do not push commits.
- Do not publish, deploy, submit URLs, or change secrets.
- Use the current Claude Code GitHub Action syntax from the installed/current docs.
- Tell me which GitHub app, permissions, and secrets are required.
- Create the workflow file only after explaining the plan.

步驟 4:starter workflow shape

最終 workflow 會因目前 Claude Code GitHub Action version 而不同,但 shape 應接近:

name: Claude SEO/GEO PR Review

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/**'
- 'app/**'
- 'pages/**'
- 'content/**'
- 'public/robots.txt'
- '**/sitemap*'
- '**/*schema*'
- '**/*seo*'
- '**/*metadata*'
- '.github/seo-geo-review-prompt.md'
- 'CLAUDE.md'

permissions:
contents: read
pull-requests: write
issues: write

jobs:
seo-geo-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Replace this with the current Claude Code GitHub Action block
# recommended by Anthropic's docs for your account.
- name: Claude SEO/GEO review
uses: anthropics/claude-code-action@beta
with:
prompt_file: .github/seo-geo-review-prompt.md
allowed_tools: 'Bash(git diff:*),Bash(git status:*),Bash(cat:*),Bash(ls:*)'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

Commit 前,請用官方 Claude Code GitHub Actions docs 驗證 action name、inputs、authentication mode 和 permissions。如果 organization 使用 Claude GitHub app,而不是 API key workflow,就遵循那套 setup。

步驟 5:讓 workflow 保持 review-only

第一版應該很 boring:

  • contents: read,不是 write
  • 允許 PR comments
  • 沒有 deployment tokens
  • 沒有 CMS tokens
  • 沒有 Search Console 或 Bing submit credentials
  • 沒有 automatic commits
  • 沒有 merge permission

如果 Claude 建議 broad permissions,問:

Reduce this GitHub Actions workflow to comment-only PR review. Explain every permission. Remove anything required for pushing commits, deployment, publishing, or URL submission.

步驟 6:用 tiny PR 測試

建立一個只改 safe title 或 markdown page 的 branch:

git checkout -b test/claude-seo-geo-review

做一個小 content change,開 PR,然後 comment:

@claude Review this PR for SEO/GEO risk using .github/seo-geo-review-prompt.md. Do not make changes.

好的 finding:

Important - src/lib/seo.ts: the canonical helper now removes locale prefixes. This may cause localized pages to canonicalize to English URLs. Verify canonical/hreflang output on one English page and one translated page before merge.

弱 finding:

Improve SEO.

如果 comments vague,收緊 prompt file 和 checklist。

步驟 7:把 repo-specific rules 加到 CLAUDE.md

Repo rules 越明確,Claude 的 PR review 越好:

## PR review rules for SEO/GEO

When reviewing PRs:
- findings first, ordered by severity
- include file references and verification steps
- do not request vague SEO improvements
- never invent product claims, customer proof, ranking data, or statistics
- treat robots, sitemap, canonical, noindex, schema, redirects, analytics, and localization changes as high risk
- if no issues are found, state residual risks and testing gaps

步驟 8:小心從 comment-only 進階到 suggested patches

Comment-only reviews 有用後,再考慮 automatic edits。即便如此,也只把 patch suggestions 限制在低風險 items:

Safe-ish patch

Still needs review

missing alt text

yes

duplicate meta description on one page

yes

broken internal link in markdown

yes

typo in FAQ heading

yes

這些保持 human-only:

  • redirects and migrations
  • robots/noindex changes
  • canonical policy
  • analytics and tag manager changes
  • legal、medical、financial 或 competitor claims
  • case-study proof 和 customer logos

FAQ

每個 PR 都應該 trigger Claude review 嗎?

不用。使用 path filters。只在 SEO、content、routing、schema、localization、analytics 和 page-template changes 觸發。

GitHub Actions 可以取代 SEO reviewer 嗎?

不行。它能抓 repeatable risks,並在 PR 裡建立 checklist。Strategy、claims 和 release timing 仍由人決定。

如果 action 無法 access secrets 怎麼辦?

保持 workflow comment-only,並依官方 Claude Code GitHub Actions setup 修 authentication。不要把 API keys 貼進 workflow files 或 PR comments。

Claude Code SEO/GEO 學習路徑

這篇屬於 Claude Code SEO/GEO operator series。如果你從零建立 workflow,請照這個順序:

  1. 如何用 Claude Code 做 SEO Automation
  2. 如何建立 Claude Code SEO/GEO Workflow Cockpit
  3. 如何把 CLAUDE.md 和 Memory 用在 SEO/GEO Workflows
  4. 如何用 Claude Code VS Code Extension 更新 SEO Pages
  5. 2026 年最佳 GEO Claude Code Skills
  6. 如何用 Claude Code Subagents 做 GEO Research
  7. 如何把 Claude Code Hooks 當成 SEO/GEO Quality Gates
  8. 如何用 MCP 將 Claude Code 接上 SEO 資料
  9. 如何用 Claude Code GitHub Actions 做 SEO/GEO Reviews
  10. 如何在 Claude Code 裡跑每日 SEO/GEO Monitoring

Sources and notes

Author: Tessa Clarke,Auspia 120+ editorial systems 的 Content Governance Lead。Tessa 撰寫審核系統、發布標準與安全 AI-assisted content operations。

探索此主題

繼續閱讀相同的成長脈絡