installation_repos
Creates, updates, deletes, gets or lists an installation_repos resource.
Overview
| Name | installation_repos |
| Type | Resource |
| Id | github.apps.installation_repos |
Fields
The following fields are returned by SELECT queries:
- list_installation_repos_for_authenticated_user
- list_repos_accessible_to_installation
The access the user has to each repository is included in the hash under the permissions key.
| Name | Datatype | Description |
|---|---|---|
repositories | array | |
repository_selection | string | |
total_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
repositories | array | |
repository_selection | string | (example: selected) |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_installation_repos_for_authenticated_user | select | installation_id | per_page, page | List repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. The access the user has to each repository is included in the hash under the permissions key. |
list_repos_accessible_to_installation | select | per_page, page | List repositories that an app installation can access. | |
add_repo_to_installation_for_authenticated_user | insert | installation_id, repository_id | Add a single repository to an installation. The authenticated user must have admin access to the repository. This endpoint only works for PATs (classic) with the repo scope. | |
remove_repo_from_installation_for_authenticated_user | delete | installation_id, repository_id | Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the repository_selection of selected.This endpoint only works for PATs (classic) with the repo scope. |
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 |
|---|---|---|
installation_id | integer | The unique identifier of the installation. |
repository_id | integer | The unique identifier of the repository. |
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_installation_repos_for_authenticated_user
- list_repos_accessible_to_installation
List repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access for an installation.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
The access the user has to each repository is included in the hash under the permissions key.
SELECT
repositories,
repository_selection,
total_count
FROM github.apps.installation_repos
WHERE installation_id = '{{ installation_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
List repositories that an app installation can access.
SELECT
repositories,
repository_selection,
total_count
FROM github.apps.installation_repos
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- add_repo_to_installation_for_authenticated_user
- Manifest
Add a single repository to an installation. The authenticated user must have admin access to the repository.
This endpoint only works for PATs (classic) with the repo scope.
INSERT INTO github.apps.installation_repos (
installation_id,
repository_id
)
SELECT
'{{ installation_id }}',
'{{ repository_id }}'
;
# Description fields are for documentation purposes
- name: installation_repos
props:
- name: installation_id
value: {{ installation_id }}
description: Required parameter for the installation_repos resource.
- name: repository_id
value: {{ repository_id }}
description: Required parameter for the installation_repos resource.
DELETE examples
- remove_repo_from_installation_for_authenticated_user
Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the repository_selection of selected.
This endpoint only works for PATs (classic) with the repo scope.
DELETE FROM github.apps.installation_repos
WHERE installation_id = '{{ installation_id }}' --required
AND repository_id = '{{ repository_id }}' --required
;