Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong api url in organisation/teams.php for add/removeRepository #921

Closed
bt-dennis-kokot opened this issue Sep 12, 2020 · 0 comments · Fixed by #985
Closed

wrong api url in organisation/teams.php for add/removeRepository #921

bt-dennis-kokot opened this issue Sep 12, 2020 · 0 comments · Fixed by #985

Comments

@bt-dennis-kokot
Copy link

bt-dennis-kokot commented Sep 12, 2020

I got a not found exception by using
$client->api('organization')->teams()->addRepository(...)

I found this in the documentation:
https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions
put /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

current code:

if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) {
    return $this->put('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params);
}

code suggestion:

if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'maintain', 'triage', 'admin'])) {
    return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant