-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
74 lines (67 loc) · 2.37 KB
/
Copy pathaction.yml
File metadata and controls
74 lines (67 loc) · 2.37 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
name: "Agent Lighthouse Audit"
description: "Audit websites for AI-agent readiness, LLM crawler access, MCP discovery, WebMCP, and Schema.org signals in CI"
author: "ForkPoint"
branding:
icon: "zap"
color: "purple"
inputs:
url:
description: "Target website or storefront URL to audit"
required: true
preset:
description: "Audit preset profile (ecommerce, saas, content, quick, full)"
required: false
default: "full"
min-score:
description: "Minimum overall score (0-100) required to pass CI"
required: false
default: "0"
assert-category:
description: "Per-category assertions (e.g. structured-data:85)"
required: false
default: ""
comment-on-pr:
description: "Post markdown summary as a pull request comment"
required: false
default: "true"
github-token:
description: "GitHub token for posting PR comments (e.g. ${{ secrets.GITHUB_TOKEN }})"
required: false
default: ""
output-dir:
description: "Output directory for reports"
required: false
default: "./reports"
runs:
using: "composite"
steps:
- name: Run Agent Lighthouse Audit
shell: bash
run: |
CMD="npx -y @forkpoint/agent-lighthouse ${{ inputs.url }} --preset=${{ inputs.preset }} --output=terminal,html,json,md --output-dir=${{ inputs.output-dir }}"
if [ "${{ inputs.min-score }}" != "0" ]; then
CMD="$CMD --min-score=${{ inputs.min-score }}"
fi
if [ -n "${{ inputs.assert-category }}" ]; then
CMD="$CMD --assert-category=${{ inputs.assert-category }}"
fi
echo "Executing: $CMD"
eval $CMD
- name: Comment on Pull Request
if: inputs.comment-on-pr == 'true' && inputs.github-token != '' && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
github-token: ${{ inputs.github-token }}
script: |
const fs = require('fs');
const path = require('path');
const reportPath = path.resolve('${{ inputs.output-dir }}', 'agent-lighthouse-report.md');
if (fs.existsSync(reportPath)) {
const body = fs.readFileSync(reportPath, 'utf8');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
}