Skip to main content

stats_contributors

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

Overview

Namestats_contributors
TypeResource
Idgithub.repos.stats_contributors

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
authorobjectA GitHub user. (title: Simple User)
totalinteger
weeksarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_contributors_statsselectowner, repo
Returns the total number of commits authored by the contributor. In addition, the response includes a Weekly Hash (weeks array) with the following information:

* w - Start of the week, given as a Unix timestamp.
* a - Number of additions
* d - Number of deletions
* c - Number of commits

> [!NOTE]
> This endpoint will return 0 values for all addition and deletion counts in repositories with 10,000 or more commits.

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


Returns the total number of commits authored by the contributor. In addition, the response includes a Weekly Hash (weeks array) with the following information:

* w - Start of the week, given as a Unix timestamp.
* a - Number of additions
* d - Number of deletions
* c - Number of commits

> [!NOTE]
> This endpoint will return 0 values for all addition and deletion counts in repositories with 10,000 or more commits.

SELECT
author,
total,
weeks
FROM github.repos.stats_contributors
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;