Post the benchmark PR comment (both benchmarks) for fork PRs too#239
Merged
NullVoxPopuli merged 1 commit intoJul 6, 2026
Merged
Conversation
bench-compare.yml runs on pull_request, where fork PRs receive a read-only token — the two-section benchmark comment (parse + project mode) was generated but only reachable through the job summary. Split posting into bench-comment.yml, triggered by workflow_run with pull-requests: write. The bench job uploads the formatted comment and PR number as an artifact; the privileged workflow downloads it, validates the named PR's head SHA against the triggering run, and creates/updates the marker-managed comment. One code path for fork and same-repo PRs; the write-token workflow never executes PR code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NullVoxPopuli
approved these changes
Jul 6, 2026
NullVoxPopuli
left a comment
Member
There was a problem hiding this comment.
GH correctly didn't run the workflow because it isn't on main yet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #236 the Benchmark Comparison workflow generates a two-section comment (Parse + Project mode (type-aware)), but for fork PRs the
pull_requesttoken is read-only, so the posting step skipped and the results were only reachable through the workflow job summary — e.g. #235 never got its benchmark comment despite the job producing one.This splits posting into the standard two-workflow pattern:
bench-compare.yml(unprivileged, runs PR code): formats the comment as before, then uploads it plus the PR number as abench-commentartifact instead of posting.bench-comment.yml(new,workflow_runon "Benchmark Comparison",pull-requests: write): downloads the artifact and creates/updates the marker-managed comment. One code path for fork and same-repo PRs.Security
The privileged workflow never checks out or executes PR code. The artifact is treated as data:
head.shamust match the triggering run'shead_sha(a fork can't redirect its comment onto another PR);Notes
workflow_runworkflows execute from the default branch's definition, so this takes effect for runs triggered after this merges. The next push to any open PR (including fork PRs like Graft .gts SourceFiles onto every virtual twin, once per program #235) will then get the two-benchmark comment.if: always()formatting still produces the "❌ failed" comment body, which now also gets posted for fork PRs.🤖 Generated with Claude Code