diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-20 13:32:05 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-20 13:59:00 -0700 |
commit | bbccce18c4d064054726f66e0b9b41cebfe314e4 (patch) | |
tree | f3cf86a18c07cda7fe4688c32b33121e49b189f7 /scripts | |
parent | 7e5b0545665f349c842d46c5e8eae7595ca5f89b (diff) | |
download | qtlocation-mapboxgl-bbccce18c4d064054726f66e0b9b41cebfe314e4.tar.gz |
[build] Disable binary size checks for fork PRs
We can't run the checks without potentially exposing the Github App private key to malicious PRs.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check_binary_size.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/check_binary_size.js b/scripts/check_binary_size.js index a12939c2af..9caa1b9998 100755 --- a/scripts/check_binary_size.js +++ b/scripts/check_binary_size.js @@ -18,7 +18,13 @@ process.on('unhandledRejection', error => { process.exit(1) }); -const key = Buffer.from(process.env['SIZE_CHECK_APP_PRIVATE_KEY'], 'base64').toString('binary'); +const pk = process.env['SIZE_CHECK_APP_PRIVATE_KEY']; +if (!pk) { + console.log('Fork PR; not computing size.'); + process.exit(0); +} + +const key = Buffer.from(pk, 'base64').toString('binary'); const payload = { exp: Math.floor(Date.now() / 1000) + 60, iat: Math.floor(Date.now() / 1000), |