Skip to main content

repos_for_secret

Creates, updates, deletes, gets or lists a repos_for_secret resource.

Overview

Namerepos_for_secret
TypeResource
Idgithub.dependabot.repos_for_secret

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
repositoriesarray
total_countinteger

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_selected_repos_for_org_secretselectorg, secret_namepage, per_pageLists all repositories that have been selected when the visibility
for repository access to a secret is set to selected.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
add_selected_repo_to_org_secretinsertorg, secret_name, repository_idAdds a repository to an organization secret when the visibility for
repository access is set to selected. The visibility is set when you Create or
update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
set_selected_repos_for_org_secretreplaceorg, secret_name, selected_repository_idsReplaces all repositories for an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
remove_selected_repo_from_org_secretdeleteorg, secret_name, repository_idRemoves a repository from an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope 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
orgstringThe organization name. The name is not case sensitive.
repository_idinteger
secret_namestringThe name of the secret.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Lists all repositories that have been selected when the visibility
for repository access to a secret is set to selected.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

SELECT
repositories,
total_count
FROM github.dependabot.repos_for_secret
WHERE org = '{{ org }}' -- required
AND secret_name = '{{ secret_name }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;

INSERT examples

Adds a repository to an organization secret when the visibility for
repository access is set to selected. The visibility is set when you Create or
update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

INSERT INTO github.dependabot.repos_for_secret (
org,
secret_name,
repository_id
)
SELECT
'{{ org }}',
'{{ secret_name }}',
'{{ repository_id }}'
;

REPLACE examples

Replaces all repositories for an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

REPLACE github.dependabot.repos_for_secret
SET
selected_repository_ids = '{{ selected_repository_ids }}'
WHERE
org = '{{ org }}' --required
AND secret_name = '{{ secret_name }}' --required
AND selected_repository_ids = '{{ selected_repository_ids }}' --required;

DELETE examples

Removes a repository from an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret
.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

DELETE FROM github.dependabot.repos_for_secret
WHERE org = '{{ org }}' --required
AND secret_name = '{{ secret_name }}' --required
AND repository_id = '{{ repository_id }}' --required
;