()
| 943 | } |
| 944 | |
| 945 | func (d *Github) getAuthenticatedUser() (*UserResp, error) { |
| 946 | res, err := d.client.R().Get("https://api.github.com/user") |
| 947 | if err != nil { |
| 948 | return nil, err |
| 949 | } |
| 950 | if res.StatusCode() != 200 { |
| 951 | return nil, toErr(res) |
| 952 | } |
| 953 | resp := &UserResp{} |
| 954 | if err = utils.Json.Unmarshal(res.Body(), resp); err != nil { |
| 955 | return nil, err |
| 956 | } |
| 957 | return resp, nil |
| 958 | } |
| 959 | |
| 960 | func (d *Github) addCommitterAndAuthor(m *map[string]interface{}) { |
| 961 | if d.CommitterName != "" { |