codeScanningCreateAutofix
Create an autofix for a code scanning alert
Details
- Method:
POST - Path:
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix - Operation ID:
code-scanning/create-autofix
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"
}
}Response Schema
{
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of an autofix.",
"enum": [
"pending",
"error",
"success",
"outdated"
]
},
"description": {
"type": "string",
"description": "The description of an autofix.",
"nullable": true
},
"started_at": {
"type": "string",
"description": "The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
"format": "date-time",
"readOnly": true
}
},
"required": [
"status",
"description",
"started_at"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('codeScanningCreateAutofix', {
# Add required parameters here
})