-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
186 lines (169 loc) · 6.47 KB
/
Copy pathaction.yml
File metadata and controls
186 lines (169 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: 'SEO Performance Report'
description: 'Unify GSC, Matomo, GA4, Clarity, and AI citations into one verdict per blog post: refresh, expand, merge, kill, hold.'
author: 'automatelab.tech'
branding:
icon: 'bar-chart-2'
color: 'blue'
inputs:
tool:
description: |
MCP tool to invoke. One of:
cohort_report, posts_list, posts_snapshot, posts_decay_curve,
posts_verdict, posts_refresh_brief, posts_cite_loss, gsc_quick_wins.
required: true
default: 'cohort_report'
input:
description: |
JSON string passed as the tool input. Example for cohort_report:
{"window": 90, "limit": 20, "min_age_days": 90}
Pass {} for tool defaults. See README for per-tool schemas.
required: false
default: '{}'
format:
description: 'Output format: json or markdown. Markdown is supported for cohort_report and posts_refresh_brief; other tools fall back to fenced JSON.'
required: false
default: 'markdown'
output-file:
description: 'Path the tool result is written to. Default: $RUNNER_TEMP/seo-perf-result.<ext>.'
required: false
default: ''
mcp-version:
description: 'Pinned npm version of @automatelab/seo-performance-mcp to run. Pin this for reproducible runs.'
required: false
default: '0.4.0'
node-version:
description: 'Node.js version to set up.'
required: false
default: '20'
# Adapter env passthrough. All optional; the verdict engine works on
# whichever slices are configured.
gsc-service-account-json:
description: 'Base64-encoded Google service-account JSON with Search Console read access.'
required: false
default: ''
gsc-site-url:
description: 'Search Console site URL, e.g. sc-domain:example.com or https://example.com/.'
required: false
default: ''
matomo-url:
description: 'Matomo instance URL.'
required: false
default: ''
matomo-token:
description: 'Matomo auth token (view access).'
required: false
default: ''
matomo-site-id:
description: 'Matomo idSite for the site to query.'
required: false
default: ''
ga4-property-id:
description: 'GA4 property ID (numeric, no G- prefix).'
required: false
default: ''
ga4-service-account-json:
description: 'Base64-encoded Google service-account JSON with GA4 Data API access.'
required: false
default: ''
clarity-project-id:
description: 'Microsoft Clarity project ID.'
required: false
default: ''
clarity-api-token:
description: 'Microsoft Clarity Data Export API token.'
required: false
default: ''
posts-sitemap-url:
description: 'XML sitemap URL used to enumerate posts. The primary platform-agnostic discovery path.'
required: false
default: ''
posts-list:
description: 'Optional JSON array overriding sitemap discovery: [{url, title?, published_at?, tags?, word_count?}, ...].'
required: false
default: ''
ghost-admin-api-url:
description: 'Optional Ghost Admin API base URL. Pair with ghost-admin-api-key for richer metadata.'
required: false
default: ''
ghost-admin-api-key:
description: 'Optional Ghost Admin API key (id:secret).'
required: false
default: ''
citation-intelligence-url:
description: 'Optional URL of a citation-intelligence MCP server to delegate AI-citation queries to.'
required: false
default: ''
outputs:
result:
description: 'Tool output (markdown or JSON, depending on `format`). Multi-line.'
value: ${{ steps.run.outputs.result }}
result-file:
description: 'Path of the file the tool result was written to.'
value: ${{ steps.run.outputs.result-file }}
rows:
description: 'For cohort_report: number of rows returned. Empty for other tools.'
value: ${{ steps.run.outputs.rows }}
runs:
using: 'composite'
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Run seo-performance tool
id: run
shell: bash
env:
TOOL: ${{ inputs.tool }}
INPUT_JSON: ${{ inputs.input }}
FORMAT: ${{ inputs.format }}
OUTPUT_FILE: ${{ inputs.output-file }}
MCP_VERSION: ${{ inputs.mcp-version }}
GSC_SERVICE_ACCOUNT_JSON: ${{ inputs.gsc-service-account-json }}
GSC_SITE_URL: ${{ inputs.gsc-site-url }}
MATOMO_URL: ${{ inputs.matomo-url }}
MATOMO_TOKEN: ${{ inputs.matomo-token }}
MATOMO_SITE_ID: ${{ inputs.matomo-site-id }}
GA4_PROPERTY_ID: ${{ inputs.ga4-property-id }}
GA4_SERVICE_ACCOUNT_JSON: ${{ inputs.ga4-service-account-json }}
CLARITY_PROJECT_ID: ${{ inputs.clarity-project-id }}
CLARITY_API_TOKEN: ${{ inputs.clarity-api-token }}
POSTS_SITEMAP_URL: ${{ inputs.posts-sitemap-url }}
POSTS_LIST: ${{ inputs.posts-list }}
GHOST_ADMIN_API_URL: ${{ inputs.ghost-admin-api-url }}
GHOST_ADMIN_API_KEY: ${{ inputs.ghost-admin-api-key }}
CITATION_INTELLIGENCE_URL: ${{ inputs.citation-intelligence-url }}
run: |
set -euo pipefail
# Pick output path
if [ -z "${OUTPUT_FILE}" ]; then
if [ "${FORMAT}" = "markdown" ]; then
OUTPUT_FILE="${RUNNER_TEMP}/seo-perf-result.md"
else
OUTPUT_FILE="${RUNNER_TEMP}/seo-perf-result.json"
fi
fi
# Write tool input JSON to a file so we never interpolate untrusted
# data into the shell command.
INPUT_FILE="${RUNNER_TEMP}/seo-perf-input.json"
printf '%s' "${INPUT_JSON}" > "${INPUT_FILE}"
npx -y -p "@automatelab/seo-performance-mcp@${MCP_VERSION}" \
seo-perf-cli "${TOOL}" \
--input-file "${INPUT_FILE}" \
--format "${FORMAT}" \
--out "${OUTPUT_FILE}"
echo "result-file=${OUTPUT_FILE}" >> "${GITHUB_OUTPUT}"
# Multi-line output: use a heredoc delimiter unlikely to clash with content.
DELIM="SEO_PERF_EOF_$(date +%s%N)"
{
echo "result<<${DELIM}"
cat "${OUTPUT_FILE}"
echo "${DELIM}"
} >> "${GITHUB_OUTPUT}"
# Surface row count for cohort_report (best-effort, JSON path only).
if [ "${TOOL}" = "cohort_report" ] || [ "${TOOL}" = "cohort_report" ]; then
if [ "${FORMAT}" = "json" ]; then
ROWS=$(node -e "const d=JSON.parse(require('fs').readFileSync(process.argv[1],'utf8')); process.stdout.write(String((d.rows||[]).length));" "${OUTPUT_FILE}")
echo "rows=${ROWS}" >> "${GITHUB_OUTPUT}"
fi
fi