Skip to main content

enterprise_dependabot_repository_access

Creates, updates, deletes, gets or lists an enterprise_dependabot_repository_access resource.

Overview

Nameenterprise_dependabot_repository_access
TypeResource
Idgithub.dependabot.enterprise_dependabot_repository_access

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
accessible_repositoriesarray
default_levelstringThe default repository access level for Dependabot updates. (public, internal) (example: internal)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
repository_access_for_enterpriseselectenterprisepage, per_pageLists 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_enterpriseupdateenterpriseUpdates 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 />&#123;<br /> "repository_ids_to_add": [123, 456],<br /> "repository_ids_to_remove": [789]<br />&#125;<br />
set_repository_access_default_level_for_enterprisereplaceenterprise, default_levelSets 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.

NameDatatypeDescription
enterprisestringThe slug version of the enterprise name.
pageintegerThe page number of results to fetch.
per_pageintegerNumber of results per page.

SELECT examples

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

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 />&#123;<br /> "repository_ids_to_add": [123, 456],<br /> "repository_ids_to_remove": [789]<br />&#125;<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

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;