@@ -12,7 +12,7 @@ import (
1212 "github.com/githubnext/gh-aw/pkg/logger"
1313)
1414
15- var sharedUtilsLog = logger .New ("cli:shared_utils " )
15+ var prAutomergeLog = logger .New ("cli:pr_automerge " )
1616
1717// PullRequest represents a GitHub Pull Request
1818type PullRequest struct {
@@ -27,7 +27,7 @@ type PullRequest struct {
2727// AutoMergePullRequestsCreatedAfter checks for open PRs in the repository created after a specific time and auto-merges them
2828// This function filters PRs to only those created after the specified time to avoid merging unrelated PRs
2929func AutoMergePullRequestsCreatedAfter (repoSlug string , createdAfter time.Time , verbose bool ) error {
30- sharedUtilsLog .Printf ("Checking for PRs in repo=%s created after %s" , repoSlug , createdAfter .Format (time .RFC3339 ))
30+ prAutomergeLog .Printf ("Checking for PRs in repo=%s created after %s" , repoSlug , createdAfter .Format (time .RFC3339 ))
3131
3232 if verbose {
3333 fmt .Fprintln (os .Stderr , console .FormatInfoMessage (fmt .Sprintf ("Checking for open pull requests in %s created after %s" , repoSlug , createdAfter .Format (time .RFC3339 ))))
@@ -37,7 +37,7 @@ func AutoMergePullRequestsCreatedAfter(repoSlug string, createdAfter time.Time,
3737 listCmd := exec .Command ("gh" , "pr" , "list" , "--repo" , repoSlug , "--json" , "number,title,isDraft,mergeable,createdAt,updatedAt" )
3838 output , err := listCmd .Output ()
3939 if err != nil {
40- sharedUtilsLog .Printf ("Failed to list pull requests: %v" , err )
40+ prAutomergeLog .Printf ("Failed to list pull requests: %v" , err )
4141 return fmt .Errorf ("failed to list pull requests: %w" , err )
4242 }
4343
@@ -64,14 +64,14 @@ func AutoMergePullRequestsCreatedAfter(repoSlug string, createdAfter time.Time,
6464 }
6565
6666 if len (eligiblePRs ) == 0 {
67- sharedUtilsLog .Print ("No eligible PRs found for auto-merge" )
67+ prAutomergeLog .Print ("No eligible PRs found for auto-merge" )
6868 if verbose {
6969 fmt .Fprintln (os .Stderr , console .FormatInfoMessage (fmt .Sprintf ("No pull requests found created after %s" , createdAfter .Format (time .RFC3339 ))))
7070 }
7171 return nil
7272 }
7373
74- sharedUtilsLog .Printf ("Found %d eligible PRs for auto-merge" , len (eligiblePRs ))
74+ prAutomergeLog .Printf ("Found %d eligible PRs for auto-merge" , len (eligiblePRs ))
7575 fmt .Fprintln (os .Stderr , console .FormatInfoMessage (fmt .Sprintf ("Found %d pull request(s) created after workflow start time" , len (eligiblePRs ))))
7676
7777 for _ , pr := range eligiblePRs {
@@ -118,7 +118,7 @@ func AutoMergePullRequestsLegacy(repoSlug string, verbose bool) error {
118118
119119// WaitForWorkflowCompletion waits for a workflow run to complete, with a specified timeout
120120func WaitForWorkflowCompletion (repoSlug , runID string , timeoutMinutes int , verbose bool ) error {
121- sharedUtilsLog .Printf ("Waiting for workflow completion: repo=%s, runID=%s, timeout=%d minutes" , repoSlug , runID , timeoutMinutes )
121+ prAutomergeLog .Printf ("Waiting for workflow completion: repo=%s, runID=%s, timeout=%d minutes" , repoSlug , runID , timeoutMinutes )
122122
123123 if verbose {
124124 fmt .Fprintln (os .Stderr , console .FormatInfoMessage (fmt .Sprintf ("Waiting for workflow completion (timeout: %d minutes)" , timeoutMinutes )))
0 commit comments