Skip to content

fix(auto-grade): allow fork PR checkout for assignment graders - #4

Closed
lassebenni wants to merge 1 commit into
HackYourFuture:mainfrom
lassebenni:fix/allow-unsafe-pr-checkout-for-autograde
Closed

fix(auto-grade): allow fork PR checkout for assignment graders#4
lassebenni wants to merge 1 commit into
HackYourFuture:mainfrom
lassebenni:fix/allow-unsafe-pr-checkout-for-autograde

Conversation

@lassebenni

Copy link
Copy Markdown

Summary

  • actions/checkout v6+ blocks fork checkouts in pull_request_target unless allow-unsafe-pr-checkout: true is set (GitHub docs).
  • This broke autograding on every HackYourAssignment/* fork PR (e.g. c55-data-week-12 run).
  • Opt in explicitly, check out head.repo.full_name @ head.sha, and set persist-credentials: false.

Security note

This workflow intentionally runs the student's .hyf/test.sh. Keep assignment repos free of high-value secrets; token stays contents: read + PR comment write.

Test plan

  • Merge, then re-run a failing pull_request_target grade job on a student fork PR
  • Confirm checkout succeeds and the score comment posts

Made with Cursor

actions/checkout v6+ refuses to check out fork heads in
pull_request_target workflows unless allow-unsafe-pr-checkout is set.
HYF assignment graders need that opt-in to run .hyf/test.sh on student
forks and post the score comment. Pin the head repo explicitly and drop
persisted credentials from the student tree.

Co-authored-by: Cursor <cursoragent@cursor.com>
lassebenni added a commit to HackYourAssignment/c55-data-week-12 that referenced this pull request Jul 24, 2026
actions/checkout v6 refuses fork heads under pull_request_target.
Pin the reusable grader to the fixed fork branch until
HackYourFuture/github-actions#4 lands on main.

Co-authored-by: Lasse Benninga <devops.pipeline@example.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
lassebenni added a commit to HackYourAssignment/c55-data-week-11 that referenced this pull request Aug 2, 2026
The grader pointed at fix/allow-unsafe-pr-checkout-for-autograde, a feature
branch whose upstream PR (HackYourFuture/github-actions#4) was closed without
merge. The pin is therefore permanent, but the name reads as disposable, and
deleting it would silently break grading for weeks 11, 12 and 14 at once.

stable/hyf-auto-grade points at the same commit (346f1ae8). No behaviour
change; this is a rename plus a comment that tells the truth.

Co-authored-by: Lasse Benninga <devops.pipeline@example.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant