Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/vp-binary-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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');
Expand Down Expand Up @@ -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,
Expand Down
Loading