MCPcopy
hub / github.com/cli/cli / unlockLockable

Function unlockLockable

pkg/cmd/issue/lock/lock.go:329–347  ·  view source on GitHub ↗

unlockLockable will unlock an issue or pull request

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

Source from the content-addressed store, hash-verified

327
328// unlockLockable will unlock an issue or pull request
329func unlockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue) error {
330
331 var mutation struct {
332 UnlockLockable struct {
333 UnlockedRecord struct {
334 Locked bool
335 }
336 } `graphql:"unlockLockable(input: $input)"`
337 }
338
339 variables := map[string]interface{}{
340 "input": githubv4.UnlockLockableInput{
341 LockableID: lockable.ID,
342 },
343 }
344
345 gql := api.NewClientFromHTTP(httpClient)
346 return gql.Mutate(repo.RepoHost(), "UnlockLockable", &mutation, variables)
347}
348
349// relockLockable will unlock then lock an issue or pull request. A common use
350// case would be to change the reason for locking.

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