Skip to content

Commit

Permalink
Use creator?
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Jan 9, 2024
1 parent eb5a519 commit b95febf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/webhooks/github/actions/repository_maintainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *repositoryMaintainers) CreateRepositoryMaintainers(ctx context.Context,
Privacy: v3.String("closed"),
})
if err != nil {
if !strings.Contains(err.Error(), "Name must be unique for this org") {
if strings.Contains(err.Error(), "Name must be unique for this org") {
r.logger.Infow("maintainers team for repository already exists", "repository", p.RepositoryName, "team", name)
} else {
return fmt.Errorf("error creating maintainers team %w", err)
Expand All @@ -89,7 +89,7 @@ func (r *repositoryMaintainers) CreateRepositoryMaintainers(ctx context.Context,
for _, additionalTeam := range r.additionalTeams {
additionalTeam := additionalTeam

_, err := r.client.GetV3Client().Teams.AddTeamRepoBySlug(ctx, r.client.Organization(), additionalTeam.teamSlug, r.client.Owner(), p.RepositoryName, &v3.TeamAddTeamRepoOptions{
_, err := r.client.GetV3Client().Teams.AddTeamRepoBySlug(ctx, r.client.Organization(), additionalTeam.teamSlug, p.Creator, p.RepositoryName, &v3.TeamAddTeamRepoOptions{
Permission: additionalTeam.permission,
})
if err != nil {
Expand Down

0 comments on commit b95febf

Please sign in to comment.