@@ -34,14 +34,13 @@ public static void upload(Project project, String report) {
34
34
35
35
String owner = System .getenv ("REPO_OWNER" );
36
36
String repo = System .getenv ("REPO_NAME" );
37
- String branch = System .getenv ("PULL_BASE_REF" );
38
37
String baseCommit = System .getenv ("PULL_BASE_SHA" );
39
38
String headCommit = System .getenv ("PULL_PULL_SHA" );
40
39
String pullRequest = System .getenv ("PULL_NUMBER" );
41
40
42
- String commit = headCommit != null && !headCommit .isEmpty () ? headCommit : baseCommit ;
41
+ String commit = headCommit != null && !headCommit .isEmpty () ? headCommit : headCommit ;
43
42
44
- post (project , report , owner , repo , commit , branch , baseCommit , pullRequest );
43
+ post (project , report , owner , repo , commit , baseCommit , pullRequest );
45
44
}
46
45
47
46
private static void post (
@@ -50,18 +49,17 @@ private static void post(
50
49
String owner ,
51
50
String repo ,
52
51
String commit ,
53
- String branch ,
54
52
String baseCommit ,
55
53
String pullRequest ) {
56
54
String post = "-X POST" ;
57
55
String headerAuth = "-H \" Authorization: Bearer $(gcloud auth print-identity-token)\" " ;
58
56
String headerContentType = "-H \" Content-Type: application/json\" " ;
59
57
String body = String .format ("-d @%s" , report );
60
58
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 );
63
61
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 );
65
63
}
66
64
67
65
String request =
0 commit comments