secretScanningGetAlert
Get a secret scanning alert
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} - Operation ID:
secret-scanning/get-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"
},
"hide_secret": {
"description": "A boolean value representing whether or not to hide literal secrets in the results.",
"required": false,
"location": "query",
"type": "boolean"
}
}Response Schema
{
"type": "object",
"properties": {
"number": {
"type": "integer",
"description": "The security alert number.",
"readOnly": true
},
"created_at": {
"type": "string",
"description": "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"description": "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
"format": "date-time",
"readOnly": true,
"nullable": true
},
"url": {
"type": "string",
"description": "The REST API URL of the alert resource.",
"format": "uri",
"readOnly": true
},
"html_url": {
"type": "string",
"description": "The GitHub URL of the alert resource.",
"format": "uri",
"readOnly": true
},
"locations_url": {
"type": "string",
"format": "uri",
"description": "The REST API URL of the code locations for this alert."
},
"state": {
"description": "Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`.",
"type": "string",
"enum": [
"open",
"resolved"
]
},
"resolution": {
"type": "string",
"description": "**Required when the `state` is `resolved`.** The reason for resolving the alert.",
"nullable": true,
"enum": [
"false_positive",
"wont_fix",
"revoked",
"used_in_tests"
]
},
"resolved_at": {
"type": "string",
"format": "date-time",
"description": "The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
"nullable": true
},
"resolved_by": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
],
"nullable": true
},
"resolution_comment": {
"type": "string",
"description": "An optional comment to resolve an alert.",
"nullable": true
},
"secret_type": {
"type": "string",
"description": "The type of secret that secret scanning detected."
},
"secret_type_display_name": {
"type": "string",
"description": "User-friendly name for the detected secret, matching the `secret_type`.\nFor a list of built-in patterns, see \"[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets).\""
},
"secret": {
"type": "string",
"description": "The secret that was detected."
},
"push_protection_bypassed": {
"type": "boolean",
"description": "Whether push protection was bypassed for the detected secret.",
"nullable": true
},
"push_protection_bypassed_by": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
],
"nullable": true
},
"push_protection_bypassed_at": {
"type": "string",
"format": "date-time",
"description": "The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
"nullable": true
},
"push_protection_bypass_request_reviewer": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
],
"nullable": true
},
"push_protection_bypass_request_reviewer_comment": {
"type": "string",
"description": "An optional comment when reviewing a push protection bypass.",
"nullable": true
},
"push_protection_bypass_request_comment": {
"type": "string",
"description": "An optional comment when requesting a push protection bypass.",
"nullable": true
},
"push_protection_bypass_request_html_url": {
"type": "string",
"format": "uri",
"description": "The URL to a push protection bypass request.",
"nullable": true
},
"validity": {
"type": "string",
"description": "The token status as of the latest validity check.",
"enum": [
"active",
"inactive",
"unknown"
]
},
"publicly_leaked": {
"type": "boolean",
"description": "Whether the detected secret was publicly leaked.",
"nullable": true
},
"multi_repo": {
"type": "boolean",
"description": "Whether the detected secret was found in multiple repositories under the same organization or enterprise.",
"nullable": true
},
"is_base64_encoded": {
"type": "boolean",
"description": "A boolean value representing whether or not alert is base64 encoded",
"nullable": true
},
"first_location_detected": {
"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"
]
}
],
"description": "Details on the location where the token was initially detected. This can be a commit, wiki commit, issue, discussion, pull request.\n",
"nullable": true
},
"has_more_locations": {
"type": "boolean",
"description": "A boolean value representing whether or not the token in the alert was detected in more than one location."
},
"assigned_to": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
],
"nullable": true
}
}
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('secretScanningGetAlert', {
# Add required parameters here
})