stats_contributors
Creates, updates, deletes, gets or lists a stats_contributors resource.
Overview
| Name | stats_contributors |
| Type | Resource |
| Id | github.repos.stats_contributors |
Fields
The following fields are returned by SELECT queries:
- get_contributors_stats
Response
| Name | Datatype | Description |
|---|---|---|
author | object | A GitHub user. (title: Simple User) |
total | integer | |
weeks | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_contributors_stats | select | owner, 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.
| 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_contributors_stats
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
;