File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,9 +133,15 @@ func flattenBypassActors(bypassActors []*github.BypassActor) []any {
133133 actorsSlice := make ([]any , 0 )
134134 for _ , v := range bypassActors {
135135 actorMap := make (map [string ]any )
136-
137- actorMap ["actor_id" ] = v .GetActorID ()
138- actorMap ["actor_type" ] = v .GetActorType ()
136+ actorID := v .GetActorID ()
137+ actorType := v .GetActorType ()
138+ if * actorType == github .BypassActorTypeOrganizationAdmin && actorID == 0 {
139+ // This is a workaround for the GitHub API bug where OrganizationAdmin actor_id is returned as `null` instead of `1`
140+ log .Printf ("[DEBUG] Setting OrganizationAdmin Actor ID to 1" )
141+ actorID = 1
142+ }
143+ actorMap ["actor_id" ] = actorID
144+ actorMap ["actor_type" ] = actorType
139145 actorMap ["bypass_mode" ] = v .GetBypassMode ()
140146
141147 actorsSlice = append (actorsSlice , actorMap )
You can’t perform that action at this time.
0 commit comments