Skip to content

Commit 964a6a1

Browse files
committed
Revert changes in the uploader.
1 parent 1366c0c commit 964a6a1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/measurement/MetricsReportUploader.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ public static void upload(Project project, String report) {
3434

3535
String owner = System.getenv("REPO_OWNER");
3636
String repo = System.getenv("REPO_NAME");
37-
String branch = System.getenv("PULL_BASE_REF");
3837
String baseCommit = System.getenv("PULL_BASE_SHA");
3938
String headCommit = System.getenv("PULL_PULL_SHA");
4039
String pullRequest = System.getenv("PULL_NUMBER");
4140

42-
String commit = headCommit != null && !headCommit.isEmpty() ? headCommit : baseCommit;
41+
String commit = headCommit != null && !headCommit.isEmpty() ? headCommit : headCommit;
4342

44-
post(project, report, owner, repo, commit, branch, baseCommit, pullRequest);
43+
post(project, report, owner, repo, commit, baseCommit, pullRequest);
4544
}
4645

4746
private static void post(
@@ -50,18 +49,17 @@ private static void post(
5049
String owner,
5150
String repo,
5251
String commit,
53-
String branch,
5452
String baseCommit,
5553
String pullRequest) {
5654
String post = "-X POST";
5755
String headerAuth = "-H \"Authorization: Bearer $(gcloud auth print-identity-token)\"";
5856
String headerContentType = "-H \"Content-Type: application/json\"";
5957
String body = String.format("-d @%s", report);
6058

61-
String template = "%s/repos/%s/%s/commits/%s/reports/?branch=%s";
62-
String endpoint = String.format(template, METRICS_SERVICE_URL, owner, repo, commit, branch);
59+
String template = "%s/repos/%s/%s/commits/%s/reports";
60+
String endpoint = String.format(template, METRICS_SERVICE_URL, owner, repo, commit);
6361
if (pullRequest != null && !pullRequest.isEmpty()) {
64-
endpoint += String.format("&base_commit=%s&pull_request=%s", baseCommit, pullRequest);
62+
endpoint += String.format("?base_commit=%s&pull_request=%s", baseCommit, pullRequest);
6563
}
6664

6765
String request =

0 commit comments

Comments
 (0)