Skip to content

Commit 98f4a27

Browse files
committed
Update sizbot to pull artifacts from public mirror
We can't use the normal download-build script in sizebot because it depends on the CircleCI artifacts API, which was recently changed to require authorization. And we can't pass an authorization token without possibly leaking it to the public, since we run sizebot on PRs from external contributors. As a temporary workaround, this job will pull the artifacts from a public mirror that I set up. But we should find some other solution so we don't have to maintain the mirror.
1 parent a013cc9 commit 98f4a27

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.circleci/config.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,17 @@ jobs:
131131
- *restore_node_modules
132132
- run:
133133
name: Download artifacts for base revision
134+
# TODO: We can't use the normal download-build script here because it
135+
# depends on the CircleCI artifacts API, which was recently changed to
136+
# require authorization. And we can't pass an authorization token
137+
# without possibly leaking it to the public, since we run sizebot on
138+
# PRs from external contributors. As a temporary workaround, this job
139+
# will pull the artifacts from a public mirror that I set up. But we
140+
# should find some other solution so we don't have to maintain
141+
# the mirror.
134142
command: |
135-
git fetch origin main
136-
cd ./scripts/release && yarn && cd ../../
137-
scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main)
138-
mv ./build ./base-build
143+
curl -L --retry 60 --retry-delay 10 --retry-max-time 600 https://react-builds.vercel.app/api/commits/$(git merge-base HEAD origin/main)/artifacts/build.tgz | tar -xz
144+
mv ./build ./base-build
139145
- run:
140146
# TODO: The `download-experimental-build` script copies the npm
141147
# packages into the `node_modules` directory. This is a historical

0 commit comments

Comments
 (0)