secretScanningListLocationsForAlert
List locations for a secret scanning alert
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations - Operation ID:
secret-scanning/list-locations-for-alert
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"alert_number": {
"description": "The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation.",
"required": true,
"location": "path",
"type": "integer"
},
"page": {
"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).\"",
"required": false,
"location": "query",
"type": "integer"
},
"per_page": {
"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).\"",
"required": false,
"location": "query",
"type": "integer"
}
}Response Schema
{
"type": "array",
"description": "List of locations where the secret was detected",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"commit",
"wiki_commit",
"issue_title",
"issue_body",
"issue_comment",
"discussion_title",
"discussion_body",
"discussion_comment",
"pull_request_title",
"pull_request_body",
"pull_request_comment",
"pull_request_review",
"pull_request_review_comment"
],
"description": "The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found.",
"example": "commit"
},
"details": {
"oneOf": [
{
"description": "Represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository.",
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file path in the repository",
"example": "/example/secrets.txt"
},
"start_line": {
"type": "number",
"description": "Line number at which the secret starts in the file"
},
"end_line": {
"type": "number",
"description": "Line number at which the secret ends in the file"
},
"start_column": {
"type": "number",
"description": "The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII"
},
"end_column": {
"type": "number",
"description": "The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII"
},
"blob_sha": {
"type": "string",
"description": "SHA-1 hash ID of the associated blob",
"example": "af5626b4a114abcb82d63db7c8082c3c4756e51b"
},
"blob_url": {
"type": "string",
"description": "The API URL to get the associated blob resource"
},
"commit_sha": {
"type": "string",
"description": "SHA-1 hash ID of the associated commit",
"example": "af5626b4a114abcb82d63db7c8082c3c4756e51b"
},
"commit_url": {
"type": "string",
"description": "The API URL to get the associated commit resource"
}
},
"required": [
"path",
"start_line",
"end_line",
"start_column",
"end_column",
"blob_sha",
"blob_url",
"commit_sha",
"commit_url"
]
},
{
"description": "Represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki.",
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file path of the wiki page",
"example": "/example/Home.md"
},
"start_line": {
"type": "number",
"description": "Line number at which the secret starts in the file"
},
"end_line": {
"type": "number",
"description": "Line number at which the secret ends in the file"
},
"start_column": {
"type": "number",
"description": "The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII."
},
"end_column": {
"type": "number",
"description": "The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII."
},
"blob_sha": {
"type": "string",
"description": "SHA-1 hash ID of the associated blob",
"example": "af5626b4a114abcb82d63db7c8082c3c4756e51b"
},
"page_url": {
"type": "string",
"description": "The GitHub URL to get the associated wiki page",
"example": "https://github.com/octocat/Hello-World/wiki/Home/302c0b7e200761c9dd9b57e57db540ee0b4293a5"
},
"commit_sha": {
"type": "string",
"description": "SHA-1 hash ID of the associated commit",
"example": "302c0b7e200761c9dd9b57e57db540ee0b4293a5"
},
"commit_url": {
"type": "string",
"description": "The GitHub URL to get the associated wiki commit",
"example": "https://github.com/octocat/Hello-World/wiki/_compare/302c0b7e200761c9dd9b57e57db540ee0b4293a5"
}
},
"required": [
"path",
"start_line",
"end_line",
"start_column",
"end_column",
"blob_sha",
"page_url",
"commit_sha",
"commit_url"
]
},
{
"description": "Represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue.",
"type": "object",
"properties": {
"issue_title_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the issue where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/1347"
}
},
"required": [
"issue_title_url"
]
},
{
"description": "Represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue.",
"type": "object",
"properties": {
"issue_body_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the issue where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/1347"
}
},
"required": [
"issue_body_url"
]
},
{
"description": "Represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue.",
"type": "object",
"properties": {
"issue_comment_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the issue comment where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1081119451"
}
},
"required": [
"issue_comment_url"
]
},
{
"description": "Represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion.",
"type": "object",
"properties": {
"discussion_title_url": {
"type": "string",
"format": "uri",
"description": "The URL to the discussion where the secret was detected.",
"example": "https://github.com/community/community/discussions/39082"
}
},
"required": [
"discussion_title_url"
]
},
{
"description": "Represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion.",
"type": "object",
"properties": {
"discussion_body_url": {
"type": "string",
"format": "uri",
"description": "The URL to the discussion where the secret was detected.",
"example": "https://github.com/community/community/discussions/39082#discussion-4566270"
}
},
"required": [
"discussion_body_url"
]
},
{
"description": "Represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion.",
"type": "object",
"properties": {
"discussion_comment_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the discussion comment where the secret was detected.",
"example": "https://github.com/community/community/discussions/39082#discussioncomment-4158232"
}
},
"required": [
"discussion_comment_url"
]
},
{
"description": "Represents a 'pull_request_title' secret scanning location type. This location type shows that a secret was detected in the title of a pull request.",
"type": "object",
"properties": {
"pull_request_title_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the pull request where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/pulls/2846"
}
},
"required": [
"pull_request_title_url"
]
},
{
"description": "Represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request.",
"type": "object",
"properties": {
"pull_request_body_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the pull request where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/pulls/2846"
}
},
"required": [
"pull_request_body_url"
]
},
{
"description": "Represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request.",
"type": "object",
"properties": {
"pull_request_comment_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the pull request comment where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1081119451"
}
},
"required": [
"pull_request_comment_url"
]
},
{
"description": "Represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request.",
"type": "object",
"properties": {
"pull_request_review_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the pull request review where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/pulls/2846/reviews/80"
}
},
"required": [
"pull_request_review_url"
]
},
{
"description": "Represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request.",
"type": "object",
"properties": {
"pull_request_review_comment_url": {
"type": "string",
"format": "uri",
"description": "The API URL to get the pull request review comment where the secret was detected.",
"example": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/12"
}
},
"required": [
"pull_request_review_comment_url"
]
}
]
}
}
}
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('secretScanningListLocationsForAlert', {
# Add required parameters here
})