Resolve @me to current username on GHE
It looks like GHE v2.20 does not support `@me` in search yet.
This commit is contained in:
parent
bed9d11f7a
commit
ff925fb480
1 changed files with 7 additions and 0 deletions
|
|
@ -408,6 +408,13 @@ func PullRequests(client *Client, repo ghrepo.Interface, currentPRNumber int, cu
|
|||
}
|
||||
`
|
||||
|
||||
if currentUsername == "@me" && ghinstance.IsEnterprise(repo.RepoHost()) {
|
||||
currentUsername, err = CurrentLoginName(client, repo.RepoHost())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
viewerQuery := fmt.Sprintf("repo:%s state:open is:pr author:%s", ghrepo.FullName(repo), currentUsername)
|
||||
reviewerQuery := fmt.Sprintf("repo:%s state:open review-requested:%s", ghrepo.FullName(repo), currentUsername)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue