Skip to content

Commit ef58845

Browse files
authored
Include branch information in metrics uploading. (#2821)
1 parent bd85150 commit ef58845

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/report_binary_size.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ function constructRequestPath() {
165165
const pullRequestNumber = process.env.GITHUB_PULL_REQUEST_NUMBER;
166166
const pullRequestBaseSha = process.env.GITHUB_PULL_REQUEST_BASE_SHA;
167167
path += `?pull_request=${pullRequestNumber}&base_commit=${pullRequestBaseSha}`;
168+
} else if (process.env.GITHUB_EVENT_NAME === 'push') {
169+
const ref = process.env.GITHUB_REF; // 'refs/heads/<some-branch-name>'
170+
const branch = ref.substring('refs/heads/'.length);
171+
path += `?branch=${branch}`;
168172
}
169173
return path;
170174
}

0 commit comments

Comments
 (0)