Skip to content

Commit 95ea705

Browse files
authored
Merge branch 'main' into fix-drift-external-collaborators
2 parents 1dbf8a4 + 7ddbf35 commit 95ea705

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

github/resource_github_repository_collaborators.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,13 @@ func updateUserCollaboratorsAndInvites(ctx context.Context, client *github.Clien
713713
if err != nil {
714714
return nil, err
715715
}
716-
inUser.invitationID = inv.ID
717-
ghInvites = append(ghInvites, inUser)
716+
// AddCollaborator returns 204 No Content (inv == nil) when the invitee
717+
// is an organization member gaining direct access without an
718+
// invitation. In that case there is no invitation ID to record.
719+
if inv != nil {
720+
inUser.invitationID = inv.ID
721+
ghInvites = append(ghInvites, inUser)
722+
}
718723
}
719724

720725
for _, l := range remove {

0 commit comments

Comments
 (0)