Skip to main content

repo_permissions

Overview

Namerepo_permissions
TypeResource
Idgithub.teams.repo_permissions

Fields

NameDatatypeDescription
idintegerUnique identifier of the repository
namestringThe name of the repository.
descriptionstring
svn_urlstring
allow_auto_mergebooleanWhether to allow Auto-merge to be used on pull requests.
watchers_countinteger
collaborators_urlstring
git_commits_urlstring
comments_urlstring
deployments_urlstring
is_templatebooleanWhether this repository acts as a template that can be used to generate new repositories.
sizeinteger
teams_urlstring
ownerobjectA GitHub user.
git_tags_urlstring
merges_urlstring
delete_branch_on_mergebooleanWhether to delete head branches when pull requests are merged
template_repositoryobjectA repository on GitHub.
issues_urlstring
branches_urlstring
permissionsobject
trees_urlstring
allow_merge_commitbooleanWhether to allow merge commits for pull requests.
languagestring
stargazers_countinteger
milestones_urlstring
forks_countinteger
has_issuesbooleanWhether issues are enabled.
languages_urlstring
events_urlstring
default_branchstringThe default branch of the repository.
full_namestring
web_commit_signoff_requiredbooleanWhether to require contributors to sign off on web-based commits
updated_atstring
contents_urlstring
labels_urlstring
pulls_urlstring
role_namestring
pushed_atstring
clone_urlstring
statuses_urlstring
open_issues_countinteger
forks_urlstring
stargazers_urlstring
contributors_urlstring
blobs_urlstring
issue_events_urlstring
subscription_urlstring
subscribers_countinteger
homepagestring
allow_forkingbooleanWhether to allow forking this repo
downloads_urlstring
issue_comment_urlstring
releases_urlstring
forksinteger
notifications_urlstring
git_refs_urlstring
subscribers_urlstring
has_downloadsbooleanWhether downloads are enabled.
licenseobjectLicense Simple
archive_urlstring
privatebooleanWhether the repository is private or public.
forkboolean
keys_urlstring
has_projectsbooleanWhether projects are enabled.
allow_squash_mergebooleanWhether to allow squash merges for pull requests.
assignees_urlstring
urlstring
master_branchstring
node_idstring
git_urlstring
ssh_urlstring
allow_rebase_mergebooleanWhether to allow rebase merges for pull requests.
has_pagesboolean
network_countinteger
tags_urlstring
archivedbooleanWhether the repository is archived.
visibilitystringThe repository visibility: public, private, or internal.
created_atstring
temp_clone_tokenstring
has_wikibooleanWhether the wiki is enabled.
watchersinteger
hooks_urlstring
topicsarray
open_issuesinteger
html_urlstring
compare_urlstring
disabledbooleanReturns whether or not this repository disabled.
mirror_urlstring
commits_urlstring

Methods

NameAccessible byRequired ParamsDescription
check_permissions_for_repo_in_orgSELECTorg, owner, repo, team_slugChecks whether a team has admin, push, maintain, triage, or pull permission for a repository. Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the application/vnd.github.v3.repository+json accept header.

If a team doesn't have permission for the repository, you will receive a 404 Not Found response status.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.
check_permissions_for_repo_legacySELECTowner, repo, team_idNote: Repositories inherited through a parent team will also be checked.

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Check team permissions for a repository endpoint.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the Accept header:
add_or_update_repo_permissions_in_orgEXECorg, owner, repo, team_slugTo add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Note: You can also specify a team by org_id and team_id using the route PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

For more information about the permission levels, see "Repository permission levels for an organization".
add_or_update_repo_permissions_legacyEXECowner, repo, team_idDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "Add or update team repository permissions" endpoint.

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization.

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."