Skip to content

Commit 07b7a72

Browse files
authored
Merge branch 'main' into refactor/tflog-actions-env-variable
2 parents c369f5b + 7ddbf35 commit 07b7a72

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
@@ -691,8 +691,13 @@ func updateUserCollaboratorsAndInvites(ctx context.Context, client *github.Clien
691691
if err != nil {
692692
return nil, err
693693
}
694-
inUser.invitationID = inv.ID
695-
ghInvites = append(ghInvites, inUser)
694+
// AddCollaborator returns 204 No Content (inv == nil) when the invitee
695+
// is an organization member gaining direct access without an
696+
// invitation. In that case there is no invitation ID to record.
697+
if inv != nil {
698+
inUser.invitationID = inv.ID
699+
ghInvites = append(ghInvites, inUser)
700+
}
696701
}
697702

698703
for _, l := range remove {

0 commit comments

Comments
 (0)