MCPcopy Create free account
hub / github.com/SignTools/SignTools / Trigger

Method Trigger

src/builders/semaphore.go:42–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (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
59func (s *Semaphore) GetStatusUrl() (string, error) {
60 return util.JoinUrls(s.baseUrl, "projects/"+s.data.ProjectName)

Callers

nothing calls this directly

Calls 3

getProjectIdMethod · 0.95
Check2xxCodeFunction · 0.92
NewMethod · 0.80

Tested by

no test coverage detected