@@ -15,6 +15,7 @@ func resourceGithubRepositoryCollaborator() *schema.Resource {
1515 return & schema.Resource {
1616 Create : resourceGithubRepositoryCollaboratorCreate ,
1717 Read : resourceGithubRepositoryCollaboratorRead ,
18+ Update : resourceGithubRepositoryCollaboratorUpdate ,
1819 Delete : resourceGithubRepositoryCollaboratorDelete ,
1920 Importer : & schema.ResourceImporter {
2021 State : schema .ImportStatePassthrough ,
@@ -39,6 +40,19 @@ func resourceGithubRepositoryCollaborator() *schema.Resource {
3940 ForceNew : true ,
4041 Default : "push" ,
4142 ValidateFunc : validateValueFunc ([]string {"pull" , "triage" , "push" , "maintain" , "admin" }),
43+ DiffSuppressFunc : func (k , old , new string , d * schema.ResourceData ) bool {
44+ if d .Get ("permission_diff_suppression" ).(bool ) {
45+ if new == "triage" || new == "maintain" {
46+ return true
47+ }
48+ }
49+ return false
50+ },
51+ },
52+ "permission_diff_suppression" : {
53+ Type : schema .TypeBool ,
54+ Optional : true ,
55+ Default : false ,
4256 },
4357 "invitation_id" : {
4458 Type : schema .TypeString ,
@@ -158,6 +172,10 @@ func resourceGithubRepositoryCollaboratorRead(d *schema.ResourceData, meta inter
158172 return nil
159173}
160174
175+ func resourceGithubRepositoryCollaboratorUpdate (d * schema.ResourceData , meta interface {}) error {
176+ return resourceGithubRepositoryCollaboratorRead (d , meta )
177+ }
178+
161179func resourceGithubRepositoryCollaboratorDelete (d * schema.ResourceData , meta interface {}) error {
162180 client := meta .(* Owner ).v3client
163181
0 commit comments