Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com> Co-authored-by: mchammer01 <42146119+mchammer01@users.noreply.github.com>
1.8 KiB
1.8 KiB
title, shortTitle, intro, permissions, versions, type, topics
| title | shortTitle | intro | permissions | versions | type | topics | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Working with push protection from the REST API | Push protection from the REST API | Learn your options for unblocking your push to {% data variables.product.prodname_dotcom %} using the REST API if {% data variables.product.prodname_secret_scanning %} detects a secret in the content of your API request. | {% data reusables.permissions.push-protection-resolve-block %} |
|
how_to |
|
About push protection from the REST API
Push protection prevents you from accidentally committing secrets to a repository by blocking pushes containing supported secrets.
The "Create a blob" and "Create or update file contents" endpoints in the REST API include push protection. See AUTOTITLE and AUTOTITLE.
If you make a request with these endpoints whose content includes a supported secret, the REST API will return a 409 error, indicating that a secret has been detected.
To resolve the error, you can either:
- Remove the secret from the content of your API request before trying again.
- Create a push protection bypass: You can bypass push protection using the "Create a push protection bypass" endpoint. For more information, see AUTOTITLE.