Probot throwing HttpError when trying to add member to a team
See original GitHub issueBug Report
Current Behavior When attempting to use the below function, an error is throw that says
ERROR probot: Validation Failed: {"code":"no_permission","field":"user","resource":"TeamMember"}
HttpError: Validation Failed: {"code":"no_permission","field":"user","resource":"TeamMember"}
const results = await context.github.teams.addOrUpdateMembershipLegacy({
team_id: accessTeamId,
username: authorOfPR
});
Expected behavior/code The member should be added to the team
Environment
- Probot version(s): 9.9.1
- @octokit/rest version: 16.40.1
- Node/npm version: Node 12.10.0 / npm 6.10.3
- OS: Windows 10
Possible Solution I’m not entirely sure if this is an issue with Probot or Octokit since I’m not sure how to get more details than just the error message I added above.
Additional context/Screenshots We have GitHub Enterprise version 2.18.4 (which is why I have to use the legacy request)
I can make requests appropriately to create a team and to remove a member from a team, but when I try to add a member to a team it errors. I’m pretty sure the privs needed to remove someone would be the same as adding, so it doesn’t seem to be a permission/priv problem.
Any help would be greatly appreciated!
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Our Enterprise version was updated to 2.20.0 and the request works now! 😄
GitHub Enterprise Support confirmed its a known issue in my enterprise version and was fixed in the next patch release. It’s listed in their release notes, the third bullet under Bug Fixes https://enterprise.github.com/releases/2.18.5/notes. My company will be upgrading to the next minor version at the end of the month, so hopefully that fix was properly carried forward into 2.19. Thank you for your help @gr2m!