Skip to content

Commit f92b41a

Browse files
authored
ci: fix bundle size job not working on external PRs (#1801)
* ci: fix bundle size job not working on external PRs * ci: exclude "built in x seconds" timing line from output
1 parent a14c4f0 commit f92b41a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/bundle-size.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
matrix:
2323
node-version: [18.x]
2424
ref:
25-
- ${{ github.event.pull_request.base.ref }}
26-
- ${{ github.event.pull_request.head.ref }}
25+
- ${{ github.event.pull_request.base.sha }}
26+
- ${{ github.event.pull_request.head.sha }}
2727
fail-fast: true
2828
steps:
2929
- uses: actions/checkout@v4
@@ -45,7 +45,7 @@ jobs:
4545
- run: corepack enable
4646
- run: yarn install --immutable
4747
- run: |
48-
yarn workspace ott-client run build | sed -r 's/([a-zA-Z]+-)[^ .]+(\.[^ ]+)/\1hash\2/' | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | tee /tmp/bundle-size.txt
48+
yarn workspace ott-client run build | sed -r 's/([a-zA-Z]+-)[^ .]+(\.[^ ]+)/\1hash\2/' | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | grep -v "built in" | tee /tmp/bundle-size.txt
4949
5050
- name: Upload bundle size
5151
uses: actions/upload-artifact@v4
@@ -63,12 +63,12 @@ jobs:
6363
- name: Download bundle size (base ref)
6464
uses: actions/download-artifact@v4
6565
with:
66-
name: bundle-size-${{ github.event.pull_request.base.ref }}
66+
name: bundle-size-${{ github.event.pull_request.base.sha }}
6767
path: /tmp/bundle-size-base.txt
6868
- name: Download bundle size (head ref)
6969
uses: actions/download-artifact@v4
7070
with:
71-
name: bundle-size-${{ github.event.pull_request.head.ref }}
71+
name: bundle-size-${{ github.event.pull_request.head.sha }}
7272
path: /tmp/bundle-size-head.txt
7373
- name: Compare bundle sizes
7474
run: |

0 commit comments

Comments
 (0)