Skip to content

Commit d5bc7e9

Browse files
committed
Properly resolve SHA for PRs
1 parent 7159915 commit d5bc7e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/gulp/tasks/payload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ task('payload', ['material:clean-build'], async () => {
3333
if (isTravisBuild()) {
3434
// Open a connection to Firebase. For master builds the database will use an admin account.
3535
const database = openFirebaseDashboardDatabase(isTravisMasterBuild());
36-
const currentSha = process.env['TRAVIS_COMMIT'];
36+
const currentSha = process.env['TRAVIS_PULL_REQUEST_SHA'] || process.env['TRAVIS_COMMIT'];
3737
const previousPayload = await getLastPayloadResults(database);
3838

3939
// Calculate library sizes by combining the CDK and Material FESM 2015 bundles.
4040
const previousSize = previousPayload.cdk_fesm_2015 + previousPayload.material_fesm_2015;
4141
const currentSize = results.cdk_fesm_2015 + results.material_fesm_2015;
4242
const deltaSize = currentSize - previousSize;
4343

44-
setGithubStatus(process.env['TRAVIS_COMMIT'], {
44+
await setGithubStatus(currentSha, {
4545
result: true,
4646
name: 'Library Payload',
4747
url: `https://travis-ci.org/angular/material2/jobs/${process.env['TRAVIS_JOB_ID']}`,

0 commit comments

Comments
 (0)