From 65d0ebd4707c3a01bc1a20f4993eb43906b8a5be Mon Sep 17 00:00:00 2001 From: MK Date: Fri, 14 Aug 2026 15:20:05 +0800 Subject: [PATCH] ci: keep binary size report in job summary for fork PRs Fork pull_request runs get a read-only token, so the whole workflow was gated to same-repo PRs and fork PRs got no size report at all. Drop the fork gate from the inputs job so fork PRs run the native input compare and the base/head builds. The comment job now always writes the size table to the job summary and returns before the comment API calls when the PR head is a fork. Cleanup stays same-repo only because deleting a comment needs a write token. --- .github/workflows/vp-binary-size.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vp-binary-size.yml b/.github/workflows/vp-binary-size.yml index bcf387e0dc..a43f59adf2 100644 --- a/.github/workflows/vp-binary-size.yml +++ b/.github/workflows/vp-binary-size.yml @@ -17,7 +17,6 @@ defaults: jobs: inputs: name: Detect native input changes - if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest permissions: contents: read @@ -237,8 +236,9 @@ jobs: comment: name: Report binary size needs: build - if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest + # Fork runs get a read-only token regardless of this block; the script + # then keeps the report in the job summary and skips the PR comment. permissions: contents: read issues: write @@ -256,6 +256,7 @@ jobs: env: HEAD_SHA: ${{ github.event.pull_request.head.sha }} SIZE_DIR: ${{ runner.temp }}/native-size + SAME_REPO: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: script: | const fs = require('node:fs'); @@ -368,6 +369,11 @@ jobs: await core.summary.addRaw(body.replace(marker, '')).write(); + if (process.env.SAME_REPO !== 'true') { + core.info('Fork PR: the report stays in the job summary above.'); + return; + } + const comments = await github.paginate(github.rest.issues.listComments, { owner: context.repo.owner, repo: context.repo.repo,