From de14c2f66be8ca7428e1ef7e26ee4fb09e0e43db Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Tue, 28 Jul 2026 21:55:20 +0200 Subject: [PATCH] ci: run PR body check on pull_request_target for fork PRs Fork student PRs were not picking up the pull_request-only body check. Also listen on pull_request_target (body-only, no head checkout) so the check runs from main for HackYourAssignment forks. Co-authored-by: Cursor --- .github/workflows/pr-body-check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pr-body-check.yml b/.github/workflows/pr-body-check.yml index c3870f1..f6109aa 100644 --- a/.github/workflows/pr-body-check.yml +++ b/.github/workflows/pr-body-check.yml @@ -6,6 +6,10 @@ name: PR body check # the REST API or `gh pr create --body "..."` (the path most AI tools take) # silently skips it. This check is the only thing that actually enforces it. # +# Uses pull_request_target (in addition to pull_request) so fork PRs always run +# the workflow from main. The job only reads github.event.pull_request.body — +# it does not check out PR head code. +# # Recovery is automatic: editing the PR description fires the `edited` event and # re-runs this check with the new body. No new commit or manual re-run needed. @@ -13,6 +17,9 @@ on: pull_request: types: [opened, edited, reopened, synchronize] branches: [main] + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] permissions: contents: read