{"command":{"effect":"read","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Lists the details of all code scanning analyses for a repository,\nstarting with the most recent.\nThe response is paginated and you can use the `page` and `per_page` parameters\nto list the analyses you're interested in.\nBy default 30 analyses are listed per page.\n\nThe `rules_count` field in the response give the number of rules\nthat were run in the analysis.\nFor very old analyses this data is not available,\nand `0` is returned in this field.\n\n> [!WARNING]\n> **Closing down notice:** The `tool_name` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.\n\nOAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.","properties":{"path":{"type":"object","properties":{"owner":{"type":"string","description":"The account owner of the repository. The name is not case sensitive."},"repo":{"type":"string","description":"The name of the repository without the `.git` extension. The name is not case sensitive."}},"required":["owner","repo"],"additionalProperties":false},"query":{"type":"object","properties":{"tool_name":{"$ref":"#/definitions/code-scanning-analysis-tool-name","description":"The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both."},"tool_guid":{"$ref":"#/definitions/code-scanning-analysis-tool-guid","description":"The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both."},"page":{"type":"integer","default":1,"description":"The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""},"per_page":{"type":"integer","default":30,"description":"The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""},"pr":{"type":"integer","description":"The number of the pull request for the results you want to list."},"ref":{"$ref":"#/definitions/code-scanning-ref","description":"The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`."},"sarif_id":{"$ref":"#/definitions/code-scanning-analysis-sarif-id","description":"Filter analyses belonging to the same SARIF upload."},"direction":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The direction to sort the results by."},"sort":{"type":"string","enum":["created"],"default":"created","description":"The property by which to sort the results."}},"required":[],"additionalProperties":false}},"required":["path"],"additionalProperties":false,"definitions":{"code-scanning-analysis-tool-name":{"type":"string","description":"The name of the tool used to generate the code scanning analysis."},"code-scanning-analysis-tool-guid":{"type":["string","null"],"description":"The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data."},"code-scanning-ref":{"type":"string","description":"The Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,\n`refs/heads/<branch name>` or simply `<branch name>`."},"code-scanning-analysis-sarif-id":{"type":"string","description":"An identifier for the upload.","examples":["6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53"]}}},"name":"List code scanning analyses for a repository","id":"github.code-scanning.list-recent-analyses","example":{"path":{"owner":"octocat","repo":"hello-world"}},"maxRequests":1,"summary":false}}