From 977c59bb33111b3cf891cbe7502ce288f79efbe3 Mon Sep 17 00:00:00 2001 From: Kyle Beggs Date: Mon, 21 Sep 2026 12:44:16 -0400 Subject: [PATCH] fix(ci): skip the benchmark PR comment on fork PRs A fork PR's GITHUB_TOKEN is read-only regardless of the permissions block, so the comment step 403s and fails a check whose benchmarks all ran (PR #102). Gate both comment steps on a same-repo head and always write the results table to the job summary, so fork PRs still show it. Agent-Harness: claude-code 2.1.278 Agent-Model: claude-opus-5[1m] Agent-Review: unreviewed Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/AirspeedVelocity.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/AirspeedVelocity.yml b/.github/workflows/AirspeedVelocity.yml index 86a04e8..6349797 100644 --- a/.github/workflows/AirspeedVelocity.yml +++ b/.github/workflows/AirspeedVelocity.yml @@ -81,7 +81,11 @@ jobs: echo 'A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.' echo 'Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).' } > body.md + cat body.md >> "$GITHUB_STEP_SUMMARY" + # A PR from a fork gets a read-only GITHUB_TOKEN whatever `permissions` asks for, + # so commenting would 403 and fail the check. Its results stay in the job summary. - name: Find Comment + if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/find-comment@v4 id: fcbenchmark with: @@ -89,6 +93,7 @@ jobs: comment-author: "github-actions[bot]" body-includes: Benchmark Results - name: Comment on PR + if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/create-or-update-comment@v5 with: comment-id: ${{ steps.fcbenchmark.outputs.comment-id }}