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

Function CheckIssue

pkg/cmd/issue/artifact/shared/shared.go:231–240  ·  view source on GitHub ↗

CheckIssue refuses a pull request, since artifacts are only supported on issues. It makes one lookup, and callers run it before any artifact request.

(c client.ArtifactClient, repo ghrepo.Interface, number int)

Source from the content-addressed store, hash-verified

229// CheckIssue refuses a pull request, since artifacts are only supported on
230// issues. It makes one lookup, and callers run it before any artifact request.
231func CheckIssue(c client.ArtifactClient, repo ghrepo.Interface, number int) error {
232 isPullRequest, err := c.IsPullRequest(repo, number)
233 if err != nil {
234 return err
235 }
236 if isPullRequest {
237 return pullRequestError(repo, number)
238 }
239 return nil
240}
241
242// CheckUploadTarget is CheckIssue for a command that uploads files with
243// --attach. It refuses a pull request the same way, and its one lookup also

Callers 7

deleteRunFunction · 0.92
viewRunFunction · 0.92
listRunFunction · 0.92
createRunFunction · 0.92
downloadRunFunction · 0.92
editRunFunction · 0.92
TestCheckIssueFunction · 0.85

Calls 2

pullRequestErrorFunction · 0.85
IsPullRequestMethod · 0.65

Tested by 1

TestCheckIssueFunction · 0.68