Skip to main content

repo_subscriptions

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

Overview

Namerepo_subscriptions
TypeResource
Idgithub.activity.repo_subscriptions

Fields

The following fields are returned by SELECT queries:

if you subscribe to the repository

NameDatatypeDescription
created_atstring (date-time) (example: 2012-10-06T21:34:12Z)
ignoredbooleanDetermines if all notifications should be blocked from this repository.
reasonstring
repository_urlstring (uri) (example: https://api.github.com/repos/octocat/example)
subscribedbooleanDetermines if notifications should be received from this repository.
urlstring (uri) (example: https://api.github.com/repos/octocat/example/subscription)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_repo_subscriptionselectowner, repoGets information about whether the authenticated user is subscribed to the repository.
set_repo_subscriptionreplaceowner, repoIf 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_subscriptiondeleteowner, repoThis 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.

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

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

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

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
;