Skip to content

ci: make PR checks fork-friendly#797

Open
LukasWallrich wants to merge 1 commit into
mainfrom
ci/fork-pr-friendly-checks
Open

ci: make PR checks fork-friendly#797
LukasWallrich wants to merge 1 commit into
mainfrom
ci/fork-pr-friendly-checks

Conversation

@LukasWallrich

Copy link
Copy Markdown
Contributor

Why

Fork pull_request runs receive a read-only GITHUB_TOKEN and no repository secrets. Several PR-check workflows assume write access, so they fail on every fork contributor's PR:

  • check_images / spell-check → the "Create or update comment" step fails with 403 Resource not accessible by integration (the image/spell check itself runs fine; only posting the comment fails).
  • staging-aggregate → checkout fails with the cryptic Input required and not supplied: token because secrets.STAGING_GITHUB_TOKEN resolves to empty.

(Separately observed during debugging: a one-off 401 Requires authentication on an internal PR was transient GitHub auth flakiness — token had write perms — and is not addressed here.)

What changed

check_images.yaml / spell-check.yaml

  • Same-repo PRs: unchanged — still post/update the bot comment.
  • Fork PRs: write the same report to the job summary ($GITHUB_STEP_SUMMARY) instead of 403ing on the comment. Report is passed via an env: var to avoid shell quoting/injection on the multiline body.

staging-aggregate.yaml

  • Fork PRs now fail fast with a clear ::error:: + job-summary note explaining that secrets aren't available to fork runs, and pointing maintainers at the manual path: run the workflow from main with single_pr=<PR#> (the fork is resolved by PR number over its public URL — no need to select the fork branch). Replaces the cryptic token error and stops build/deploy-staging from running.
  • Added a header comment documenting that fork-preview path.

Notes

  • Branch detection uses github.event.pull_request.head.repo.full_name != github.repository.
  • Because these workflows run from each PR's own branch version, currently-open fork PRs won't pick up the new behavior until they rebase/merge past this; PRs branched afterward will.
  • link-check.yaml also posts comments but only triggers on schedule/workflow_dispatch (never fork PRs), so it needs no change.

🤖 Generated with Claude Code

Fork pull_request runs get a read-only GITHUB_TOKEN and no repo secrets,
so steps that post PR comments or use the staging PAT fail (403/empty
token) on every fork PR. Handle forks explicitly:

- check_images / spell-check: keep posting the PR comment for same-repo
  PRs, but on fork PRs write the same report to the job summary instead
  of 403ing on the comment write.
- staging-aggregate: fail fast on fork PRs with a clear note pointing
  maintainers at the manual single_pr workflow_dispatch, replacing the
  cryptic "Input required and not supplied: token" checkout error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LukasWallrich LukasWallrich requested a review from a team as a code owner June 10, 2026 18:13
@github-actions

Copy link
Copy Markdown
Contributor

👍 All image files/references (if any) are in webp format, in line with our policy.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Spell Check Passed

No spelling issues found when checking 3 changed file(s)! 🎉

@LukasWallrich

Copy link
Copy Markdown
Contributor Author

Staging Deployment Status

This PR has been successfully deployed to staging as part of an aggregated deployment.

Deployed at: 2026-06-10 18:17:21 UTC
Staging URL: https://staging.forrt.org

The staging site shows the combined state of all compatible open PRs.

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