Skip to content

Commit 4c31c61

Browse files
committed
Implement scripts, fixtures, workflows, and docs
Completes the v1 action: scripts/ detect-changes.sh — find SKILL.md paths for PR, issue_comment, push events evaluate-backend.sh — free-tier mode; calls api.skill-lab.dev endpoints evaluate-cli.sh — BYOK mode; pip installs sklab and shells to it apply-optimize.sh — reads markers from last comment, commits to PR branch build-comment.sh — renders unified results JSON into PR markdown upsert-comment.sh — PATCH-or-POST via sklab-action marker, fork-safe fallback tests/fixtures/ good-skill/, bad-skill/, malicious-skill/ — exercise all gates .github/workflows/ test.yml — self-test matrix against the fixtures release.yml — moves v<major> tag on release:published README.md — inputs/outputs tables, 6 example workflows, troubleshooting, results schema for downstream consumers
1 parent 5b4b248 commit 4c31c61

12 files changed

Lines changed: 1349 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
retag:
12+
name: Move major tag
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Move v<major> tag to this release
20+
env:
21+
TAG_NAME: ${{ github.event.release.tag_name }}
22+
run: |
23+
set -euo pipefail
24+
# Accept v1.2.3, v1.2, v1 — extract the leading vN.
25+
if [[ ! "$TAG_NAME" =~ ^v[0-9]+ ]]; then
26+
echo "Release tag '$TAG_NAME' does not start with vN; skipping major-tag move"
27+
exit 0
28+
fi
29+
MAJOR="$(echo "$TAG_NAME" | grep -oE '^v[0-9]+')"
30+
31+
git config user.name "github-actions[bot]"
32+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
33+
34+
git tag -f "$MAJOR" "$TAG_NAME"
35+
git push origin "$MAJOR" --force
36+
37+
echo "Moved $MAJOR → $TAG_NAME"

.github/workflows/test.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Self-test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
# Review mode — static + security. No LLM, no API key.
15+
review-good:
16+
name: review · good-skill (expect pass)
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: ./
21+
id: run
22+
with:
23+
mode: review
24+
path: tests/fixtures/good-skill
25+
comment: false
26+
- run: |
27+
echo "any-failed=${{ steps.run.outputs.any-failed }}"
28+
echo "skills-count=${{ steps.run.outputs.skills-count }}"
29+
30+
review-bad:
31+
name: review · bad-skill (informational, low score expected)
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: ./
36+
id: run
37+
with:
38+
mode: review
39+
path: tests/fixtures/bad-skill
40+
comment: false
41+
fail-threshold: "0" # informational; don't fail the job
42+
- run: |
43+
echo "any-failed=${{ steps.run.outputs.any-failed }}"
44+
45+
# Security gate must trip on the malicious fixture.
46+
review-malicious:
47+
name: review · malicious-skill (expect BLOCK)
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: ./
52+
id: run
53+
continue-on-error: true
54+
with:
55+
mode: review
56+
path: tests/fixtures/malicious-skill
57+
comment: false
58+
security-gate: "true"
59+
- name: Expect security failure
60+
run: |
61+
if [ "${{ steps.run.outputs.any-failed }}" != "true" ]; then
62+
echo "::error::Expected security-gate to fail on malicious-skill, got any-failed='${{ steps.run.outputs.any-failed }}'"
63+
exit 1
64+
fi
65+
66+
# Judge mode hits the backend. Skipped if backend is unreachable at test time.
67+
judge-backend:
68+
name: judge · good-skill (backend LLM)
69+
runs-on: ubuntu-latest
70+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: ./
74+
id: run
75+
continue-on-error: true
76+
with:
77+
mode: judge
78+
path: tests/fixtures/good-skill
79+
comment: false
80+
- run: |
81+
echo "any-failed=${{ steps.run.outputs.any-failed }}"
82+
echo "total-cost=${{ steps.run.outputs.total-cost }}"

0 commit comments

Comments
 (0)