@@ -37,25 +37,23 @@ func (c Client) FetchAssignedIssues(ctx context.Context) ([]trello.Card, error)
3737 return entrello .CreateCardsFromIssues (nonPullRequestIssues )
3838}
3939
40- func (c Client ) FetchOtherPullRequests () func (ctx context.Context ) ([]trello.Card , error ) {
41- return func (ctx context.Context ) ([]trello.Card , error ) {
42- pullRequests := make ([]* github.PullRequest , 0 )
43- for _ , repo := range config .SubscribedRepos {
44- prs , _ , err := c .client .PullRequests .List (ctx , config .OrgName , repo , nil )
45- if err != nil {
46- return nil , fmt .Errorf ("could not retrieve pull requests from %s/%s: %w" , config .OrgName , repo , err )
47- }
48- pullRequests = append (pullRequests , prs ... )
40+ func (c Client ) FetchOtherPullRequests (ctx context.Context ) ([]trello.Card , error ) {
41+ pullRequests := make ([]* github.PullRequest , 0 )
42+ for _ , repo := range config .SubscribedRepos {
43+ prs , _ , err := c .client .PullRequests .List (ctx , config .OrgName , repo , nil )
44+ if err != nil {
45+ return nil , fmt .Errorf ("could not retrieve pull requests from %s/%s: %w" , config .OrgName , repo , err )
4946 }
47+ pullRequests = append (pullRequests , prs ... )
48+ }
5049
51- otherPullRequests := make ([]* github.PullRequest , 0 )
52- for _ , i := range pullRequests {
53- if ! * i .Draft && * i .User .Login != config .UserName && (i .Assignee == nil || * i .Assignee .Login != config .UserName ) {
54- otherPullRequests = append (otherPullRequests , i )
55- }
50+ otherPullRequests := make ([]* github.PullRequest , 0 )
51+ for _ , i := range pullRequests {
52+ if ! * i .Draft && * i .User .Login != config .UserName && (i .Assignee == nil || * i .Assignee .Login != config .UserName ) {
53+ otherPullRequests = append (otherPullRequests , i )
5654 }
57- return entrello .CreateCardsFromPullRequests (otherPullRequests )
5855 }
56+ return entrello .CreateCardsFromPullRequests (otherPullRequests )
5957}
6058
6159func (c Client ) FetchOtherPullRequestsAssignedToMe (ctx context.Context ) ([]trello.Card , error ) {
0 commit comments