feat: GitHub Action — audit changed markdown in PRs#8
Conversation
… app repo) Composite action at .github/actions/avoid-ai-writing/. Detects changed *.md files in a PR (filtered by the user's paths globs), POSTs each to the audit API at avoidaiwriting.com, posts a single summary review comment back to the PR. Composite + bash (not a JS action) on purpose: the skill repo is intentionally zero-build (markdown only). curl + gh + jq cover the full path without committing a bundled dist/index.js. Fails open across the board — missing API key, rejected key, oversized file, exhausted credits, network error per file all return exit 0 so a flaky audit can't block a merge. Per-file caps mirror the server's 60KB / 5000-word limits so we don't burn a credit just to get a 400. Example workflow lives in docs/example-workflow.yml (not .github/workflows/) so it stays a reference template — the skill repo doesn't yet have an AVOID_API_KEY secret, and a live workflow here would fail on every PR until that's configured. Also backfills the missing [3.3.1] CHANGELOG entry for the 'hit differently' Tier 1 addition (commit 088c4ad).
|
@copilot review |
Reviewed the current PR changes at |
Five-agent review (code, silent-failure, API-contract, security, UX-adopter)Two hard blockers prevent first-run success. After those, ~5 high-priority items before this is comfortable to ship publicly. Implementation logic is sound and the API wiring is correct against current 🔴 Blockers (will fail first run or violate stated invariants)
🟠 High
🟡 Medium
🟢 Low / informational
✅ Clean
Priority order to ship
5/5 agents converged on overlapping findings; the blockers above were independently surfaced by at least two lenses each. 🤖 Reviewed by: pr-review-toolkit:code-reviewer, pr-review-toolkit:silent-failure-hunter, general-purpose × 3 (API contract, security, UX adoption) |
|
Superseded by avoid-ai-writing-app#405. After the sub-agent review on this PR surfaced 5 blockers + a security HIGH + several UX gaps, decided to move the Action out of the OSS skill repo entirely. The OSS skill is a free local-LLM tool; the Action is a paid-API consumer. They're different surfaces and shouldn't share a README. All 5 blockers + the |
Implements the GitHub Action half of avoid-ai-writing-app#110.
Summary
A composite GitHub Action at
.github/actions/avoid-ai-writing/that auto-runs on PRs touching markdown, audits each changed file via the live API at avoidaiwriting.com, and posts a single summary review comment back to the PR. Three changed files, ~270 lines of bash + yaml, nonode_modulesto bundle.Why composite + bash (not a JS action)
The skill repo is intentionally zero-build (markdown only). A JS action means committing a bundled
dist/index.js, which is review noise + a maintenance surface that isn't worth it for this action's narrow scope.curl + gh + jqcover the full path cleanly.Failure-open posture
Every error path exits
0so a flaky audit can't block a merge:::warning::+ skip401) → halt run, log, exit 0402) → partial summary + credit notePre-flight size check matches the server's
MAX_TEXT_LENGTHso we don't burn a credit just to come back as 400.Example workflow location
docs/example-workflow.yml, not.github/workflows/. The skill repo doesn't have anAVOID_API_KEYsecret set yet; an active workflow here would fail on every PR until that's configured. Move to.github/workflows/to enable.Also in this PR
[3.3.1]CHANGELOG entry for the "hit differently" Tier 1 addition (commit088c4adfrom 4/17, never made it into CHANGELOG).Test plan
AVOID_API_KEYsecret, copydocs/example-workflow.ymlto.github/workflows/, open a PR with a doc change → verify summary comment posts