repos
Creates, updates, deletes, gets or lists a repos resource.
Overview
| Name | repos |
| Type | Resource |
| Id | github.interactions.repos |
Fields
The following fields are returned by SELECT queries:
- get_restrictions_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
expires_at | string (date-time) | (example: 2018-08-17T04:18:39Z) |
limit | string | The 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) |
origin | string | (example: repository) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_restrictions_for_repo | select | owner, repo | 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. | |
set_restrictions_for_repo | replace | owner, repo, limit | 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. | |
remove_restrictions_for_repo | delete | owner, repo | 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. |
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 |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_restrictions_for_repo
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
- set_restrictions_for_repo
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
- remove_restrictions_for_repo
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
;