Skip to main content

repos

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

Overview

Namerepos
TypeResource
Idgithub.interactions.repos

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
expires_atstring (date-time) (example: 2018-08-17T04:18:39Z)
limitstringThe type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. (existing_users, contributors_only, collaborators_only) (example: collaborators_only)
originstring (example: repository)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_restrictions_for_reposelectowner, repoShows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
set_restrictions_for_reporeplaceowner, repo, limitTemporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.
remove_restrictions_for_repodeleteowner, repoRemoves all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.

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
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.

SELECT
expires_at,
limit,
origin
FROM github.interactions.repos
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

REPLACE examples

Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.

REPLACE github.interactions.repos
SET
limit = '{{ limit }}',
expiry = '{{ expiry }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND limit = '{{ limit }}' --required
RETURNING
expires_at,
limit,
origin;

DELETE examples

Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.

DELETE FROM github.interactions.repos
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
;