Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: github_repository_collaborators - mark invitation_ids as changed when new user invited #1825

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions github/resource_github_repository_collaborators.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strconv"

"github.com/google/go-github/v53/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/customdiff"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down Expand Up @@ -75,6 +76,14 @@ func resourceGithubRepositoryCollaborators() *schema.Resource {
Computed: true,
},
},

CustomizeDiff: customdiff.Sequence(
// If there was a new user added to the list of collaborators,
// it's possible a new invitation id will be created in GitHub.
customdiff.ComputedIf("invitation_ids", func(d *schema.ResourceDiff, meta interface{}) bool {
return d.HasChange("user")
}),
),
}
}

Expand Down
10 changes: 5 additions & 5 deletions website/docs/d/organization_external_identities.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ If a user is managed by SAML, the `saml_identity` object will contain:

If a user is managed by SCIM, the `scim_identity` object will contain:

- `scim_username` - The member's SCIM Username. (will be empty string if user is
not managed by SCIM)
- `scim_groups` - The member's SCIM Groups
- `scim_family_name` - The member's SCIM Family Name
- `scim_given_name` - The member's SCIM Given Name
- `username` - The member's SCIM Username. (will be empty string if user is not
managed by SCIM)
- `groups` - The member's SCIM Groups
- `family_name` - The member's SCIM Family Name
- `given_name` - The member's SCIM Given Name