You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move away from deprecated Teams API Endpoints (#32)
On March 15, 2022 at 14:00 UTC GitHub will deprecate an endpoint under path /teams/:team_id
Source: https://github.blog/changelog/2022-02-22-sunset-notice-deprecated-teams-api-endpoints/
To use a new endpoint this PR upgrades `google/go-github` module to version v42.0.0.
This is a minimal set of changes to mitigate effects of the deprecation:
- replace call to `githubClient.Teams.ListTeamMembers` with `githubClient.Teams.ListTeamMembersByID`
- add a call to `githubClient.Organizations.Get` - to retrieve an organisation ID, which is required `ListTeamMembersByID`, from only it's name
- adjust test accordingly
m, resteam, err:=c.githubClient.Teams.ListTeamMembersByID(ctxTimeout, org.GetID(), team.GetID(), opts)
268
282
iferr!=nil {
269
283
fn()
270
284
returnnil, fmt.Errorf("error listing members for team %q in organisation %q: %w", name, organisation, err)
271
285
}
272
-
ifres.StatusCode>=300 {
286
+
ifresteam.StatusCode>=300 {
273
287
fn()
274
-
returnnil, fmt.Errorf("error listing members for team %q in organisation %q (status: %d): %s", name, organisation, res.StatusCode, readAllClose(res.Body))
288
+
returnnil, fmt.Errorf("error listing members for team %q in organisation %q (status: %d): %s", name, organisation, resteam.StatusCode, readAllClose(resteam.Body))
0 commit comments