Better error message when org doesn't exist
* Produce a better error message when the destination org doesn't exist. * Support pushing to the authenticated user's account **Before** `error creating github repository `synced-actions/setup-node`: error creating repository: POST http://my-ghes-hostname/api/v3/orgs/synced-actions/repos: 404 Not Found []` **After** `error creating github repository `synced-actions/setup-node`: Organization `synced-actions` doesn't exist at http://my-ghes-hostname. You must create it first.` https://github.com/actions/actions-sync/issues/1
This commit is contained in:
@@ -19,6 +19,18 @@ func main() {
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {})
|
||||
|
||||
r.HandleFunc("/api/v3/orgs/{org}", func(w http.ResponseWriter, r *http.Request) {
|
||||
orgName := mux.Vars(r)["org"]
|
||||
|
||||
org := github.Organization{Login: &orgName}
|
||||
b, _ := json.Marshal(org)
|
||||
_, err := w.Write(b)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
})
|
||||
|
||||
r.HandleFunc("/api/v3/orgs/{org}/repos", func(w http.ResponseWriter, r *http.Request) {
|
||||
orgName := mux.Vars(r)["org"]
|
||||
b, err := ioutil.ReadAll(r.Body)
|
||||
|
||||
Reference in New Issue
Block a user