MCPcopy
hub / github.com/cli/cli / lockLockable

Function lockLockable

pkg/cmd/issue/lock/lock.go:308–326  ·  view source on GitHub ↗

lockLockable will lock an issue or pull request

(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue, opts *LockOptions)

Source from the content-addressed store, hash-verified

306
307// lockLockable will lock an issue or pull request
308func lockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue, opts *LockOptions) error {
309 var mutation struct {
310 LockLockable struct {
311 LockedRecord struct {
312 Locked bool
313 }
314 } `graphql:"lockLockable(input: $input)"`
315 }
316
317 variables := map[string]interface{}{
318 "input": githubv4.LockLockableInput{
319 LockableID: lockable.ID,
320 LockReason: reasonsMap[opts.Reason],
321 },
322 }
323
324 gql := api.NewClientFromHTTP(httpClient)
325 return gql.Mutate(repo.RepoHost(), "LockLockable", &mutation, variables)
326}
327
328// unlockLockable will unlock an issue or pull request
329func unlockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue) error {

Callers 2

lockRunFunction · 0.85
relockLockableFunction · 0.85

Calls 3

NewClientFromHTTPFunction · 0.92
MutateMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected