Commit Graph

3 Commits

Author SHA1 Message Date
Gauvino
935cacff81 fix(pr-validation): paginate issue comments + guard unreadable body file
Addresses review: github.rest.issues.listComments only returns the first page,
so the sticky-comment marker could be missed on busy PRs — use github.paginate.
And guard readFileSync so a missing/unreadable body file exits 2 (per the doc)
instead of crashing without JSON.
2026-06-01 20:22:28 +02:00
Gauvino
5f59dce0c7 fix(pr-validation): run under pull_request_target + drop DoS-prone comment loop
Security audit fixes:
- The jobs gated on github.event_name == 'pull_request' but the trigger is
  pull_request_target, so they never ran (validation was silently disabled).
  Gate on 'pull_request_target'.
- Replace the loop-until-stable HTML-comment strip with a single linear pass
  (+ trailing-unterminated strip): still leaves no <!-- (CodeQL-clean) but
  removes the quadratic re-scan a crafted nested-comment body could abuse.
2026-06-01 20:14:24 +02:00
Gauvino
3de9b65b7d ci(pr-validation): validate PR title + body against the template
New .github/workflows/pr-validation.yml (pull_request_target, like seerr, so it
works on fork PRs without checking out fork code): moves the Conventional-Commits
title check out of the quality gate and adds a PR template check
(scripts/check-pr-template.mjs) — Description/Ticket/Testing filled, contribution
+ AI-disclosure boxes ticked (maintainers bypass AI), and Screenshots required
when the PR changes UI (.tsx under app/ or components/). Posts a sticky comment +
'blocked: template' label on failure, clears on success; skips bots + synchronize.
Robust comment stripping (CodeQL-safe). Inspired by seerr's pr-validation.
2026-06-01 17:24:03 +02:00