mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: payload status should not show all digits (#6051)
* Currently we always limit the difference in kilobytes to two digits after the decimal point. This also needs to be done for the full package size to avoid super long numbers.
This commit is contained in:
committed by
Andrew Seguin
parent
055f662a85
commit
f3b4e7c6b0
@@ -36,11 +36,12 @@ export const payloadGithubStatus = https.onRequest(async (request, response) =>
|
||||
// Better message about the diff that shows whether the payload increased or decreased.
|
||||
const diffMessage = packageDiff < 0 ? 'decrease' : 'increase';
|
||||
const diffFormatted = Math.abs(packageDiff).toFixed(2);
|
||||
const packageSizeFormatted = packageSize.toFixed(2);
|
||||
|
||||
await setGithubStatus(commitSha, {
|
||||
result: true,
|
||||
name: `${capitalizeFirstLetter(packageName)} Payload Size`,
|
||||
description: `${packageSize}kb / ${diffFormatted}kb ${diffMessage} (ES2015 bundle)`
|
||||
description: `${packageSizeFormatted}kb / ${diffFormatted}kb ${diffMessage} (ES2015 bundle)`
|
||||
});
|
||||
|
||||
response.json({message: 'Payload Github status successfully set.'});
|
||||
|
||||
Reference in New Issue
Block a user