Agentic SEO Check #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |