New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new command issue pin
#5597
base: trunk
Are you sure you want to change the base?
Conversation
| // isPinned is an invalid field for PullRequest | ||
| prFields := make([]string, len(fields)) | ||
| for i, f := range fields { | ||
| if f == "isPinned" { | ||
| prFields = append(fields[:i], fields[i+1:]...) | ||
| break | ||
| } | ||
| } | ||
|
|
||
| query := fmt.Sprintf(` | ||
| query IssueByNumber($owner: String!, $repo: String!, $number: Int!) { | ||
| repository(owner: $owner, name: $repo) { | ||
| hasIssuesEnabled | ||
| issue: issueOrPullRequest(number: $number) { | ||
| __typename | ||
| ...on Issue{%[1]s} | ||
| ...on PullRequest{%[1]s} | ||
| ...on PullRequest{%[2]s} | ||
| } | ||
| } | ||
| }`, api.PullRequestGraphQL(fields)) | ||
| }`, api.PullRequestGraphQL(fields), api.PullRequestGraphQL(prFields)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lmk if there is a better way to do this. My graphql knowledge is limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository has pinnedIssues (see here).
Might potentially give better performance but could also opt for this solution for consistency.
edit: ah forget it, you aren't listing them but rather looking up by number
Fixes #5585
Adds the
issue pincommand to pin issues to a repositoryAdds the
--removeflag to remove pinned issues from a repository