/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofixCreate an autofix for a code scanning alert
Creates an autofix for a code scanning alert using the repository's default branch. If an autofix already exists, the response returns it; if one is being generated, the response confirms the request was accepted. OAuth app tokens and personal access tokens (classic) require the security_events scope for public or private repositories, or the public_repo scope for public repositories only.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
A 400 is returned when the request is invalid; a 403 is returned if the repository is archived, GitHub Advanced Security is not enabled, or the rate limit is exceeded; a 404 is returned when the repository or alert is not found. A 422 indicates the request cannot be processed, and a 500 indicates an internal error. The owner and repo path parameters must identify the repository, alert_number must identify the alert, and the token must have the applicable scope.