Skip to content

Commit

Permalink
Merge pull request #39 from grafana/use-right-repository-property
Browse files Browse the repository at this point in the history
Use the right repository property
  • Loading branch information
jotdl authored May 24, 2024
2 parents 6004b44 + bd58346 commit 7981e8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/icassigner/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ func (a *Action) Run(ctx context.Context, event *github.IssuesEvent, dryRun bool
return nil
}

if event.Issue.Repository == nil || event.Issue.Repository.Name == nil {
log.Fatalf("Can't set any assignee as the repository or its name is missing, payload: %+v", event.Issue.Repository)
if event.Repo == nil || event.Repo.Name == nil {
log.Fatalf("Can't set any assignee as the repository or its name is missing, payload: %+v", event.Repo)
}

if event.Issue.Repository.Owner == nil || event.Issue.Repository.Owner.Login == nil {
log.Fatalf("Can't set any assignee as the repository owner or its login name is missing, payload: %+v", event.Issue.Repository.Owner)
if event.Repo.Owner == nil || event.Repo.Owner.Login == nil {
log.Fatalf("Can't set any assignee as the repository owner or its login name is missing, payload: %+v", event.Repo.Owner)
}

_, _, err = a.Client.Issues.AddAssignees(ctx, *event.Issue.Repository.Owner.Login, *event.Issue.Repository.Name, *event.Issue.Number, []string{theChosenOne.Name})
_, _, err = a.Client.Issues.AddAssignees(ctx, *event.Repo.Owner.Login, *event.Repo.Name, *event.Issue.Number, []string{theChosenOne.Name})

return err
}
Expand Down

0 comments on commit 7981e8a

Please sign in to comment.