enterprise_dependabot_repository_access
Creates, updates, deletes, gets or lists an enterprise_dependabot_repository_access resource.
Overview
| Name | enterprise_dependabot_repository_access |
| Type | Resource |
| Id | github.dependabot.enterprise_dependabot_repository_access |
Fields
The following fields are returned by SELECT queries:
- repository_access_for_enterprise
Response
| Name | Datatype | Description |
|---|---|---|
accessible_repositories | array | |
default_level | string | The default repository access level for Dependabot updates. (public, internal) (example: internal) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
repository_access_for_enterprise | select | enterprise | page, per_page | Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise. The authenticated user must be an enterprise owner to use this endpoint. |
update_repository_access_for_enterprise | update | enterprise | Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise. The authenticated user must be an enterprise owner to use this endpoint. Example request body: json<br />{<br /> "repository_ids_to_add": [123, 456],<br /> "repository_ids_to_remove": [789]<br />}<br /> | |
set_repository_access_default_level_for_enterprise | replace | enterprise, default_level | Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are: - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. The authenticated user must be an enterprise owner to use this endpoint. |
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 |
|---|---|---|
enterprise | string | The slug version of the enterprise name. |
page | integer | The page number of results to fetch. |
per_page | integer | Number of results per page. |
SELECT examples
- repository_access_for_enterprise
Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise.
The authenticated user must be an enterprise owner to use this endpoint.
SELECT
accessible_repositories,
default_level
FROM github.dependabot.enterprise_dependabot_repository_access
WHERE enterprise = '{{ enterprise }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
UPDATE examples
- update_repository_access_for_enterprise
Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise.
The authenticated user must be an enterprise owner to use this endpoint.
Example request body:json<br />{<br /> "repository_ids_to_add": [123, 456],<br /> "repository_ids_to_remove": [789]<br />}<br />
UPDATE github.dependabot.enterprise_dependabot_repository_access
SET
repository_ids_to_add = '{{ repository_ids_to_add }}',
repository_ids_to_remove = '{{ repository_ids_to_remove }}'
WHERE
enterprise = '{{ enterprise }}' --required;
REPLACE examples
- set_repository_access_default_level_for_enterprise
Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are:
- 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories.
- 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories.
The authenticated user must be an enterprise owner to use this endpoint.
REPLACE github.dependabot.enterprise_dependabot_repository_access
SET
default_level = '{{ default_level }}'
WHERE
enterprise = '{{ enterprise }}' --required
AND default_level = '{{ default_level }}' --required;