@@ -38,8 +38,10 @@ func FetchRefStat(repo, ref, statName, apiToken string) (string, error) {
38
38
return "" , err
39
39
}
40
40
41
+ context := githubContextForStatName (statName )
42
+
41
43
for _ , status := range refStatus .Statuses {
42
- if status .Context == statName {
44
+ if status .Context == context {
43
45
return commitstatStatus .ParseStatFromDescription (status .Description ), nil
44
46
}
45
47
}
@@ -56,7 +58,7 @@ func SubmitStatus(repo, sha, statName string, status *commitstatStatus.Status, a
56
58
State : string (status .State ),
57
59
Description : status .Description ,
58
60
TargetURL : targetURL ,
59
- Context : "commitstat/" + statName ,
61
+ Context : githubContextForStatName ( statName ) ,
60
62
}
61
63
githubStatusJSON , _ := json .Marshal (githubStatus )
62
64
statusesURL := fmt .Sprintf ("/repos/%s/statuses/%s" , repo , sha )
@@ -72,6 +74,10 @@ func SubmitStatus(repo, sha, statName string, status *commitstatStatus.Status, a
72
74
return nil
73
75
}
74
76
77
+ func githubContextForStatName (statName string ) string {
78
+ return "commitstat/" + statName
79
+ }
80
+
75
81
func request (verb string , url string , input []byte , apiToken string ) (* http.Response , string , error ) {
76
82
baseUrl := "https://api.github.com"
77
83
if overrideURL := os .Getenv ("GITHUB_API_URL" ); overrideURL != "" {
0 commit comments