@@ -34,6 +34,12 @@ trait PullRequestService {
34
34
/** OAuth token for drone, needed to cancel builds */
35
35
def droneToken : String
36
36
37
+ /** OAuthed application's "client_id" */
38
+ def githubClientId : String
39
+
40
+ /** OAuthed application's "client_secret" */
41
+ def githubClientSecret : String
42
+
37
43
/** Pull Request HTTP service */
38
44
val prService = HttpService {
39
45
case request @ POST -> Root =>
@@ -68,21 +74,23 @@ trait PullRequestService {
68
74
)
69
75
70
76
private [this ] val githubUrl = " https://api.github.com"
77
+ private [this ] def withGithubSecret (url : String , extras : String * ): String =
78
+ s " $url?client_id= $githubClientId&client_secret= $githubClientSecret" + extras.mkString(" &" , " &" , " " )
71
79
72
80
def claUrl (userName : String ): String =
73
81
s " https://www.lightbend.com/contribute/cla/scala/check/ $userName"
74
82
75
83
def commitsUrl (prNumber : Int ): String =
76
- s " $githubUrl/repos/lampepfl/dotty/pulls/ $prNumber/commits? per_page=100 "
84
+ withGithubSecret( s " $githubUrl/repos/lampepfl/dotty/pulls/ $prNumber/commits " , " per_page=100" )
77
85
78
86
def statusUrl (sha : String ): String =
79
- s " $githubUrl/repos/lampepfl/dotty/statuses/ $sha"
87
+ withGithubSecret( s " $githubUrl/repos/lampepfl/dotty/statuses/ $sha" )
80
88
81
89
def issueCommentsUrl (issueNbr : Int ): String =
82
- s " $githubUrl/repos/lampepfl/dotty/issues/ $issueNbr/comments "
90
+ withGithubSecret( s " $githubUrl/repos/lampepfl/dotty/issues/ $issueNbr/comments " )
83
91
84
92
def reviewUrl (issueNbr : Int ): String =
85
- s " $githubUrl/repos/lampepfl/dotty/pulls/ $issueNbr/reviews "
93
+ withGithubSecret( s " $githubUrl/repos/lampepfl/dotty/pulls/ $issueNbr/reviews " )
86
94
87
95
sealed trait CommitStatus {
88
96
def commit : Commit
0 commit comments