repo_subscriptions
Creates, updates, deletes, gets or lists a repo_subscriptions resource.
Overview
| Name | repo_subscriptions |
| Type | Resource |
| Id | github.activity.repo_subscriptions |
Fields
The following fields are returned by SELECT queries:
- get_repo_subscription
if you subscribe to the repository
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | (example: 2012-10-06T21:34:12Z) |
ignored | boolean | Determines if all notifications should be blocked from this repository. |
reason | string | |
repository_url | string (uri) | (example: https://api.github.com/repos/octocat/example) |
subscribed | boolean | Determines if notifications should be received from this repository. |
url | string (uri) | (example: https://api.github.com/repos/octocat/example/subscription) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_repo_subscription | select | owner, repo | Gets information about whether the authenticated user is subscribed to the repository. | |
set_repo_subscription | replace | owner, repo | If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely. | |
delete_repo_subscription | delete | owner, repo | This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually. |
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_repo_subscription
Gets information about whether the authenticated user is subscribed to the repository.
SELECT
created_at,
ignored,
reason,
repository_url,
subscribed,
url
FROM github.activity.repo_subscriptions
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
REPLACE examples
- set_repo_subscription
If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.
REPLACE github.activity.repo_subscriptions
SET
subscribed = {{ subscribed }},
ignored = {{ ignored }}
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
RETURNING
created_at,
ignored,
reason,
repository_url,
subscribed,
url;
DELETE examples
- delete_repo_subscription
This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.
DELETE FROM github.activity.repo_subscriptions
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
;