()
| 40 | } |
| 41 | |
| 42 | func (s *Semaphore) Trigger() error { |
| 43 | projectId, err := s.getProjectId() |
| 44 | if err != nil { |
| 45 | return err |
| 46 | } |
| 47 | body := fmt.Sprintf(`project_id=%s&reference=%s`, projectId, s.data.Ref) |
| 48 | resp, err := s.client.New(). |
| 49 | Body(bytes.NewReader([]byte(body))). |
| 50 | Set("Content-Type", "application/x-www-form-urlencoded"). |
| 51 | Post("v1alpha/plumber-workflows"). |
| 52 | ReceiveSuccess(nil) |
| 53 | if err != nil { |
| 54 | return err |
| 55 | } |
| 56 | return util.Check2xxCode(resp.StatusCode) |
| 57 | } |
| 58 | |
| 59 | func (s *Semaphore) GetStatusUrl() (string, error) { |
| 60 | return util.JoinUrls(s.baseUrl, "projects/"+s.data.ProjectName) |
nothing calls this directly
no test coverage detected