Skip to content

Commit

Permalink
Return a list of URLS instead of PR name
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaslana committed May 3, 2024
1 parent f6f5378 commit 6529935
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/github/checkStalePRs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
"github.com/chia-network/github-bot/internal/config"
)

func CheckStalePRs(githubClient *github.Client, internalTeam string, cfg config.LabelConfig) ([]*github.PullRequest, error) {
var stalePRs []*github.PullRequest
// CheckstalePRs will return a list of PRs
func CheckStalePRs(githubClient *github.Client, internalTeam string, cfg config.LabelConfig) ([]string, error) {
var stalePRUrls []string
cutoffDate := time.Now().AddDate(0, 0, -7) // 7 days ago
teamMembers, err := GetTeamMemberList(githubClient, internalTeam)
if err != nil {
Expand All @@ -35,11 +36,11 @@ func CheckStalePRs(githubClient *github.Client, internalTeam string, cfg config.

for _, pr := range communityPRs {
if isStale(githubClient, pr, teamMembers, cutoffDate) {
stalePRs = append(stalePRs, pr)
stalePRUrls = append(stalePRUrls, pr.GetHTMLURL()) // Collecting URLs instead of PR objects
}
}
}
return stalePRs, nil
return stalePRUrls, nil
}

// Checks if a PR is stale based on the last update from team members
Expand Down

0 comments on commit 6529935

Please sign in to comment.