Skip to content

Commit 51f5968

Browse files
authored
CI: Fix report-size.yml execution (#25625)
1 parent 2f650da commit 51f5968

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/read-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
TREESHAKEN_GZIP=$(stat --format=%s test/treeshake/index.bundle.min.js.gz)
4343
4444
# write the output in a json file to upload it as artifact
45-
node -pe "JSON.stringify({ filesize: $FILESIZE, gzip: $FILESIZE_GZIP, treeshaken: $TREESHAKEN, treeshakenGzip: $TREESHAKEN_GZIP })" > sizes.json
45+
node -pe "JSON.stringify({ filesize: $FILESIZE, gzip: $FILESIZE_GZIP, treeshaken: $TREESHAKEN, treeshakenGzip: $TREESHAKEN_GZIP, pr: ${{ github.event.pull_request.number }} })" > sizes.json
4646
- name: Upload artifact
4747
uses: actions/upload-artifact@v3
4848
with:

.github/workflows/report-size.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
if: github.event.workflow_run.event == 'pull_request' &&
2222
github.event.workflow_run.conclusion == 'success'
2323
steps:
24+
- name: Log GitHub context
25+
env:
26+
GITHUB_CONTEXT: ${{ toJson(github) }}
27+
run: echo "$GITHUB_CONTEXT"
28+
2429
# Using actions/download-artifact doesn't work here
2530
# https://github.com/actions/download-artifact/issues/60
2631
- name: Download artifact
@@ -101,13 +106,13 @@ jobs:
101106
uses: peter-evans/find-comment@v2
102107
id: find-comment
103108
with:
104-
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
109+
issue-number: ${{ fromJSON(steps.download-artifact.outputs.result).pr }}
105110
comment-author: 'github-actions[bot]'
106111
body-includes: Bundle size
107112
- name: Comment on PR
108113
uses: peter-evans/create-or-update-comment@v2
109114
with:
110-
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
115+
issue-number: ${{ fromJSON(steps.download-artifact.outputs.result).pr }}
111116
comment-id: ${{ steps.find-comment.outputs.comment-id }}
112117
edit-mode: replace
113118
body: |

0 commit comments

Comments
 (0)