findings
Creates, updates, deletes, gets or lists a findings resource.
Overview
| Name | findings |
| Type | Resource |
| Id | github.code_quality.findings |
Fields
The following fields are returned by SELECT queries:
- get_finding
- list_findings_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The time the code quality finding was created. |
location | object | Code quality file location |
message | object | Code quality finding message |
number | integer | The finding number. |
rule | object | Code quality rule |
state | string | State of the code quality finding. (open, dismissed) |
url | string (uri) | The REST API URL of the code quality finding resource. |
Response
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The time the code quality finding was created. |
location | object | Code quality file location |
message | object | Code quality finding message |
number | integer | The finding number. |
rule | object | Code quality rule |
state | string | State of the code quality finding. (open, dismissed) |
url | string (uri) | The REST API URL of the code quality finding resource. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_finding | select | owner, repo, finding_number | Gets a single code quality finding. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. | |
list_findings_for_repo | select | owner, repo | per_page, direction, before, after, state | Lists code quality findings for a repository. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. |
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 |
|---|---|---|
finding_number | integer | The number that identifies a finding. |
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. |
after | string | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
before | string | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
direction | string | The direction to sort the results by. |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
state | string | If specified, only code quality findings with this state will be returned. |
SELECT examples
- get_finding
- list_findings_for_repo
Gets a single code quality finding.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
SELECT
created_at,
location,
message,
number,
rule,
state,
url
FROM github.code_quality.findings
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND finding_number = '{{ finding_number }}' -- required
;
Lists code quality findings for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
SELECT
created_at,
location,
message,
number,
rule,
state,
url
FROM github.code_quality.findings
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND direction = '{{ direction }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
AND state = '{{ state }}'
;