Conversation
Fork PRs run the Performance Benchmarks workflow with a read-only GITHUB_TOKEN, so its inline github-script comment step 403s with "Resource not accessible by integration". Move the comment posting to a workflow_run follow-up that runs in the base-repo context with a write token, matching the post-test-status.yml pattern. The benchmark job now records the PR number into the results artifact so the follow-up can find the PR for fork contributions, where the workflow_run payload omits it.
|
camdecoster
reviewed
Sep 17, 2026
camdecoster
left a comment
Contributor
There was a problem hiding this comment.
Looks good overall. Could you pin the actions to commit hashes?
Comment on lines
+3
to
+8
| # Posts the benchmark results comment in the base-repo context (with a | ||
| # read/write token) after the Performance Benchmarks workflow finishes. Fork | ||
| # PRs run that workflow with a read-only GITHUB_TOKEN, so its own comment step | ||
| # would 403 ("Resource not accessible by integration"). Same pattern as | ||
| # post-test-status.yml. The results and the PR number arrive via the | ||
| # benchmark-results artifact. |
Contributor
There was a problem hiding this comment.
The comment step has been removed, so this comment should be updated.
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.



Problem
On community (fork) PRs the Performance Benchmarks workflow fails to post its results comment:
Fork PRs run with a read-only
GITHUB_TOKEN, so thepull-requests: writedeclared inbenchmarks.ymlis silently capped and the inlineactions/github-scriptcomment step 403s. This can't be fixed inside that workflow: GitHub caps the token because the run executed fork-authored code.Fix
Same pattern the repo already uses in
post-test-status.yml: do the privileged work in aworkflow_runfollow-up, which runs in the base-repo context with a real read/write token even for forks.benchmarks.yml: drop the inline comment step (and the now-unused top-levelpull-requests: write). Record the PR number into thebenchmark-resultsartifact, sinceworkflow_run's payload omits it for fork PRs.post-benchmark-comment.yml: on Performance Benchmarks completion, download the artifact and post/update the sticky comment.The benchmark job still runs and still fails the check on a hard regression; only the comment posting moves to where it has permission.
Guards: the follow-up skips cleanly (no red check) when a cancelled/superseded run left no artifact, and the PR-number step is
always()so a pre-benchmark CI flake doesn't lose it.Notes
workflow_runreads the workflow file from the default branch, so the follow-up won't fire until this merges todev. It can't be exercised end-to-end from this branch alone.