repos
Creates, updates, deletes, gets or lists a repos resource.
Overview
| Name | repos |
| Type | Resource |
| Id | github.teams.repos |
Fields
The following fields are returned by SELECT queries:
- list_repos_in_org
- list_repos_legacy
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | (example: Hello-World) |
node_id | string | (example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5) |
full_name | string | (example: octocat/Hello-World) |
role_name | string | (example: admin) |
allow_forking | boolean | |
archive_url | string | (example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}) |
archived | boolean | |
assignees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}) |
blobs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}) |
branches_url | string | (example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}) |
clone_url | string | |
code_of_conduct | object | Code Of Conduct (title: Code Of Conduct) |
collaborators_url | string | (example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}) |
comments_url | string | (example: http://api.github.com/repos/octocat/Hello-World/comments{/number}) |
commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}) |
compare_url | string | (example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}) |
contents_url | string | (example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}) |
contributors_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/contributors) |
created_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
custom_properties | object | The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. |
default_branch | string | |
delete_branch_on_merge | boolean | |
deployments_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/deployments) |
description | string | (example: This your first repo!) |
disabled | boolean | |
downloads_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/downloads) |
events_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/events) |
fork | boolean | |
forks | integer | |
forks_count | integer | |
forks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/forks) |
git_commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}) |
git_refs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}) |
git_tags_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}) |
git_url | string | |
has_discussions | boolean | |
has_downloads | boolean | |
has_issues | boolean | |
has_pages | boolean | |
has_projects | boolean | |
has_pull_requests | boolean | |
has_wiki | boolean | |
homepage | string | |
hooks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/hooks) |
html_url | string (uri) | (example: https://github.com/octocat/Hello-World) |
is_template | boolean | |
issue_comment_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}) |
issue_events_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}) |
issues_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues{/number}) |
keys_url | string | (example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}) |
labels_url | string | (example: http://api.github.com/repos/octocat/Hello-World/labels{/name}) |
language | string | |
languages_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/languages) |
license | object | |
merges_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/merges) |
milestones_url | string | (example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}) |
mirror_url | string | |
network_count | integer | |
notifications_url | string | (example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}) |
open_issues | integer | |
open_issues_count | integer | |
owner | object | A GitHub user. (title: Simple User) |
permissions | object | |
private | boolean | |
pull_request_creation_policy | string | The policy controlling who can create pull requests: all or collaborators_only. (all, collaborators_only) |
pulls_url | string | (example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
releases_url | string | (example: http://api.github.com/repos/octocat/Hello-World/releases{/id}) |
security_and_analysis | object | |
size | integer | The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. |
ssh_url | string | |
stargazers_count | integer | |
stargazers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/stargazers) |
statuses_url | string | (example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}) |
subscribers_count | integer | |
subscribers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscribers) |
subscription_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscription) |
svn_url | string | |
tags_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/tags) |
teams_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/teams) |
temp_clone_token | string | |
topics | array | |
trees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}) |
updated_at | string (date-time) | (example: 2011-01-26T19:14:43Z) |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World) |
visibility | string | |
watchers | integer | |
watchers_count | integer | |
web_commit_signoff_required | boolean |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | (example: Hello-World) |
node_id | string | (example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5) |
full_name | string | (example: octocat/Hello-World) |
role_name | string | (example: admin) |
allow_forking | boolean | |
archive_url | string | (example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}) |
archived | boolean | |
assignees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}) |
blobs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}) |
branches_url | string | (example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}) |
clone_url | string | |
code_of_conduct | object | Code Of Conduct (title: Code Of Conduct) |
collaborators_url | string | (example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}) |
comments_url | string | (example: http://api.github.com/repos/octocat/Hello-World/comments{/number}) |
commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}) |
compare_url | string | (example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}) |
contents_url | string | (example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}) |
contributors_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/contributors) |
created_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
custom_properties | object | The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. |
default_branch | string | |
delete_branch_on_merge | boolean | |
deployments_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/deployments) |
description | string | (example: This your first repo!) |
disabled | boolean | |
downloads_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/downloads) |
events_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/events) |
fork | boolean | |
forks | integer | |
forks_count | integer | |
forks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/forks) |
git_commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}) |
git_refs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}) |
git_tags_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}) |
git_url | string | |
has_discussions | boolean | |
has_downloads | boolean | |
has_issues | boolean | |
has_pages | boolean | |
has_projects | boolean | |
has_pull_requests | boolean | |
has_wiki | boolean | |
homepage | string | |
hooks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/hooks) |
html_url | string (uri) | (example: https://github.com/octocat/Hello-World) |
is_template | boolean | |
issue_comment_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}) |
issue_events_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}) |
issues_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues{/number}) |
keys_url | string | (example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}) |
labels_url | string | (example: http://api.github.com/repos/octocat/Hello-World/labels{/name}) |
language | string | |
languages_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/languages) |
license | object | |
merges_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/merges) |
milestones_url | string | (example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}) |
mirror_url | string | |
network_count | integer | |
notifications_url | string | (example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}) |
open_issues | integer | |
open_issues_count | integer | |
owner | object | A GitHub user. (title: Simple User) |
permissions | object | |
private | boolean | |
pull_request_creation_policy | string | The policy controlling who can create pull requests: all or collaborators_only. (all, collaborators_only) |
pulls_url | string | (example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
releases_url | string | (example: http://api.github.com/repos/octocat/Hello-World/releases{/id}) |
security_and_analysis | object | |
size | integer | The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. |
ssh_url | string | |
stargazers_count | integer | |
stargazers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/stargazers) |
statuses_url | string | (example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}) |
subscribers_count | integer | |
subscribers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscribers) |
subscription_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscription) |
svn_url | string | |
tags_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/tags) |
teams_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/teams) |
temp_clone_token | string | |
topics | array | |
trees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}) |
updated_at | string (date-time) | (example: 2011-01-26T19:14:43Z) |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World) |
visibility | string | |
watchers | integer | |
watchers_count | integer | |
web_commit_signoff_required | boolean |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_repos_in_org | select | org, team_slug | per_page, page | Lists a team's repositories visible to the authenticated user. > [!NOTE] > You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos. |
list_repos_legacy | select | team_id | per_page, page | > [!WARNING] > Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List team repositories endpoint. |
remove_repo_in_org | delete | org, team_slug, owner, repo | If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. > [!NOTE] > You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}. | |
remove_repo_legacy | delete | team_id, owner, repo | > [!WARNING] > Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove a repository from a team endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
team_id | integer | The unique identifier of the team. |
team_slug | string | The slug of the team name. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_repos_in_org
- list_repos_legacy
Lists a team's repositories visible to the authenticated user.
> [!NOTE]
> You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos.
SELECT
id,
name,
node_id,
full_name,
role_name,
allow_forking,
archive_url,
archived,
assignees_url,
blobs_url,
branches_url,
clone_url,
code_of_conduct,
collaborators_url,
comments_url,
commits_url,
compare_url,
contents_url,
contributors_url,
created_at,
custom_properties,
default_branch,
delete_branch_on_merge,
deployments_url,
description,
disabled,
downloads_url,
events_url,
fork,
forks,
forks_count,
forks_url,
git_commits_url,
git_refs_url,
git_tags_url,
git_url,
has_discussions,
has_downloads,
has_issues,
has_pages,
has_projects,
has_pull_requests,
has_wiki,
homepage,
hooks_url,
html_url,
is_template,
issue_comment_url,
issue_events_url,
issues_url,
keys_url,
labels_url,
language,
languages_url,
license,
merges_url,
milestones_url,
mirror_url,
network_count,
notifications_url,
open_issues,
open_issues_count,
owner,
permissions,
private,
pull_request_creation_policy,
pulls_url,
pushed_at,
releases_url,
security_and_analysis,
size,
ssh_url,
stargazers_count,
stargazers_url,
statuses_url,
subscribers_count,
subscribers_url,
subscription_url,
svn_url,
tags_url,
teams_url,
temp_clone_token,
topics,
trees_url,
updated_at,
url,
visibility,
watchers,
watchers_count,
web_commit_signoff_required
FROM github.teams.repos
WHERE org = '{{ org }}' -- required
AND team_slug = '{{ team_slug }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
> [!WARNING]
> Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List team repositories endpoint.
SELECT
id,
name,
node_id,
full_name,
role_name,
allow_forking,
archive_url,
archived,
assignees_url,
blobs_url,
branches_url,
clone_url,
code_of_conduct,
collaborators_url,
comments_url,
commits_url,
compare_url,
contents_url,
contributors_url,
created_at,
custom_properties,
default_branch,
delete_branch_on_merge,
deployments_url,
description,
disabled,
downloads_url,
events_url,
fork,
forks,
forks_count,
forks_url,
git_commits_url,
git_refs_url,
git_tags_url,
git_url,
has_discussions,
has_downloads,
has_issues,
has_pages,
has_projects,
has_pull_requests,
has_wiki,
homepage,
hooks_url,
html_url,
is_template,
issue_comment_url,
issue_events_url,
issues_url,
keys_url,
labels_url,
language,
languages_url,
license,
merges_url,
milestones_url,
mirror_url,
network_count,
notifications_url,
open_issues,
open_issues_count,
owner,
permissions,
private,
pull_request_creation_policy,
pulls_url,
pushed_at,
releases_url,
security_and_analysis,
size,
ssh_url,
stargazers_count,
stargazers_url,
statuses_url,
subscribers_count,
subscribers_url,
subscription_url,
svn_url,
tags_url,
teams_url,
temp_clone_token,
topics,
trees_url,
updated_at,
url,
visibility,
watchers,
watchers_count,
web_commit_signoff_required
FROM github.teams.repos
WHERE team_id = '{{ team_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
DELETE examples
- remove_repo_in_org
- remove_repo_legacy
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.
> [!NOTE]
> You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.
DELETE FROM github.teams.repos
WHERE org = '{{ org }}' --required
AND team_slug = '{{ team_slug }}' --required
AND owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
;
> [!WARNING]
> Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove a repository from a team endpoint.
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.
DELETE FROM github.teams.repos
WHERE team_id = '{{ team_id }}' --required
AND owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
;