MCPcopy Create free account
hub / github.com/cli/cli / cancelWorkflowRun

Function cancelWorkflowRun

pkg/cmd/run/cancel/cancel.go:144–158  ·  view source on GitHub ↗
(client *api.Client, repo ghrepo.Interface, runID string, force bool)

Source from the content-addressed store, hash-verified

142}
143
144func cancelWorkflowRun(client *api.Client, repo ghrepo.Interface, runID string, force bool) error {
145 var path string
146 if force {
147 path = fmt.Sprintf("repos/%s/actions/runs/%s/force-cancel", ghrepo.FullName(repo), runID)
148 } else {
149 path = fmt.Sprintf("repos/%s/actions/runs/%s/cancel", ghrepo.FullName(repo), runID)
150 }
151
152 err := client.REST(repo.RepoHost(), "POST", path, nil, nil)
153 if err != nil {
154 return err
155 }
156
157 return nil
158}

Callers 1

runCancelFunction · 0.85

Calls 3

FullNameFunction · 0.92
RESTMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…