-
Notifications
You must be signed in to change notification settings - Fork 157
62 lines (49 loc) · 1.74 KB
/
Copy pathagentic-seo.yaml
File metadata and controls
62 lines (49 loc) · 1.74 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
name: Agentic SEO Check
on:
schedule:
- cron: "20 7 * * 1"
workflow_dispatch:
jobs:
analyze:
if: github.repository == 'canonical/canonical.com'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run Agentic SEO
run: npx agentic-seo@1.0.0 --json > agentic-seo-results.json || true
- name: Output results to Job Summary
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
// 1. Read and parse the JSON output
let results;
try {
const fileContent = fs.readFileSync('./agentic-seo-results.json', 'utf8');
results = JSON.parse(fileContent);
} catch (err) {
console.log("Could not read JSON output.", err);
return;
}
const { score, grade, summary } = results;
// 2. Format the output
const body = `### 🤖 Agentic SEO Check
**Score:** ${score}/100
**Grade:** ${grade}
**Summary:**
* 🔴 **Errors:** ${summary.errors}
* 🟠 **Warnings:** ${summary.warnings}
* 🟢 **Passed:** ${summary.passed}
_Run \`npx agentic-seo\` locally to see the full breakdown and fixes._
`;
const summaryFile = process.env.GITHUB_STEP_SUMMARY;
fs.appendFileSync(summaryFile, body);