summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-20 13:32:05 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-07-20 13:59:00 -0700
commitbbccce18c4d064054726f66e0b9b41cebfe314e4 (patch)
treef3cf86a18c07cda7fe4688c32b33121e49b189f7 /scripts
parent7e5b0545665f349c842d46c5e8eae7595ca5f89b (diff)
downloadqtlocation-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-xscripts/check_binary_size.js8
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),