Skip to content

Commit 0f953c7

Browse files
aldevvbtipling
authored andcommitted
fix github deprecated calls
1 parent cb0094b commit 0f953c7

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

pkg/connector/api_token.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/conductorone/baton-sdk/pkg/pagination"
1010
resourceSdk "github.com/conductorone/baton-sdk/pkg/types/resource"
1111
"github.com/google/go-github/v69/github"
12-
"github.com/shurcooL/githubv4"
1312
)
1413

1514
func apiTokenResource(ctx context.Context, token *github.PersonalAccessToken) (*v2.Resource, error) {
@@ -49,7 +48,6 @@ func apiTokenResource(ctx context.Context, token *github.PersonalAccessToken) (*
4948
type apiTokenResourceType struct {
5049
resourceType *v2.ResourceType
5150
client *github.Client
52-
graphClient *githubv4.Client
5351
hasSAMLEnabled *bool
5452
orgCache *orgNameCache
5553
}

pkg/connector/org.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func (o *orgResourceType) Grant(ctx context.Context, principal *v2.Resource, en
314314
}
315315

316316
// User is a member but grant is for admin, so make them an admin.
317-
_, _, err = o.client.Organizations.EditOrgMembership(ctx, user.GetLogin(), orgName, &github.Membership{Role: github.String(orgRoleAdmin)})
317+
_, _, err = o.client.Organizations.EditOrgMembership(ctx, user.GetLogin(), orgName, &github.Membership{Role: github.Ptr(orgRoleAdmin)})
318318
if err != nil {
319319
return nil, fmt.Errorf("github-connectorv2: failed to make user an admin : %w", err)
320320
}
@@ -376,7 +376,7 @@ func (o *orgResourceType) Revoke(ctx context.Context, grant *v2.Grant) (annotati
376376
return nil, nil
377377
}
378378

379-
_, _, err = o.client.Organizations.EditOrgMembership(ctx, user.GetLogin(), orgName, &github.Membership{Role: github.String(orgRoleMember)})
379+
_, _, err = o.client.Organizations.EditOrgMembership(ctx, user.GetLogin(), orgName, &github.Membership{Role: github.Ptr(orgRoleMember)})
380380
if err != nil {
381381
return nil, fmt.Errorf("github-connectorv2: failed to revoke org admin from user: %w", err)
382382
}

test/mocks/github.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ func (mgh MockGitHub) getMembers(
391391
func userToMembership(user *github.User) github.Membership {
392392
return github.Membership{
393393
User: user,
394-
Role: github.String("admin"),
395-
State: github.String("active"),
394+
Role: github.Ptr("admin"),
395+
State: github.Ptr("active"),
396396
}
397397
}
398398

0 commit comments

Comments
 (0)