Skip to content

Commit 790eb8b

Browse files
committed
clean up pull request sync
1 parent 7f827c6 commit 790eb8b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/ctrlc/root/sync/github/pullrequest.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewSyncPullRequestsCmd() *cobra.Command {
5858
cmd.Flags().StringVarP(&owner, "owner", "o", "", "GitHub repository owner (user or organization)")
5959
cmd.Flags().StringVarP(&repo, "repo", "r", "", "GitHub repository name")
6060
cmd.Flags().StringVarP(&token, "token", "t", "", "GitHub API token (can also be set via GITHUB_TOKEN env var)")
61-
cmd.Flags().StringSliceVarP(&states, "state", "s", nil, "Filter pull requests by state: all, open, closed, draft, merged (can be specified multiple times)")
61+
cmd.Flags().StringSliceVarP(&states, "state", "s", []string{"open"}, "Filter pull requests by state: all, open, closed, draft, merged (can be specified multiple times)")
6262
cmd.MarkFlagRequired("owner")
6363
cmd.MarkFlagRequired("repo")
6464

@@ -261,8 +261,8 @@ func processPullRequests(ctx context.Context, client *github.Client, owner, repo
261261
"states", states)
262262

263263
resources := []api.AgentResource{}
264-
for i, pr := range filteredPRs {
265-
log.Info("Processing pull request", "index", i+1, "of", len(filteredPRs), "number", pr.GetNumber())
264+
for _, pr := range filteredPRs {
265+
log.Info("Processing pull request", "number", pr.GetNumber(), "source", pr.GetHead().GetRef(), "target", pr.GetBase().GetRef())
266266
resource, err := processPullRequest(ctx, client, owner, repo, pr)
267267
if err != nil {
268268
log.Error("Failed to process pull request", "number", pr.GetNumber(), "error", err)
@@ -495,10 +495,8 @@ func processPullRequest(ctx context.Context, client *github.Client, owner, repo
495495
Identifier: "github-" + pr.GetNodeID(),
496496
Config: map[string]any{
497497
"number": prNumber,
498-
"title": pr.GetTitle(),
499498
"url": prUrl,
500499
"state": pr.GetState(),
501-
"body": pr.GetBody(),
502500
"createdAt": pr.GetCreatedAt().Format(time.RFC3339),
503501
"updatedAt": pr.GetUpdatedAt().Format(time.RFC3339),
504502
"branch": branchInfo,

0 commit comments

Comments
 (0)