From b22302cd0636f88e572c5b42492bc0d8d19806c9 Mon Sep 17 00:00:00 2001 From: x-rush <78290977+x-rush@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:40:07 +0800 Subject: [PATCH] Make the lexer benchmark succeed on fork pull requests Fork pull requests run with a read-only token, regardless of the permissions the workflow requests, so posting or updating the result comment always failed with a 403 and marked the whole check as failed, even though the benchmark itself succeeded. Write the benchmark table to the job summary, so the results are visible on the run page for every contributor, and skip the comment step for fork pull requests, where the read-only token cannot post comments. Branches in this repository keep posting the comment as before. --- .github/workflows/lexer-benchmark.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lexer-benchmark.yml b/.github/workflows/lexer-benchmark.yml index 9c41005f0..53de7ef7b 100644 --- a/.github/workflows/lexer-benchmark.yml +++ b/.github/workflows/lexer-benchmark.yml @@ -83,9 +83,14 @@ jobs: echo "cd packages/mysql-on-sqlite && composer run bench-lexer" echo '```' } > "$RUNNER_TEMP/comment.md" + cat "$RUNNER_TEMP/comment.md" >> "$GITHUB_STEP_SUMMARY" echo "COMMENT_FILE=$RUNNER_TEMP/comment.md" >> "$GITHUB_ENV" - name: Post or update the PR comment + # Fork pull requests run with a read-only token and cannot post + # comments. For those, the benchmark results are available in the job + # summary above, and the step is skipped so that the check succeeds. + if: github.event.pull_request.head.repo.fork != true uses: actions/github-script@v7 with: script: |