Co-authored-by: Hirsch Singhal <1666363+hpsin@users.noreply.github.com> Co-authored-by: Jovel Crisostomo <jovel@github.com> Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com> Co-authored-by: Vanessa <vgrl@github.com>
1.7 KiB
1.7 KiB
title, intro, versions, topics, miniTocMaxHeadingLevel
| title | intro | versions | topics | miniTocMaxHeadingLevel | |||
|---|---|---|---|---|---|---|---|
| Pre-receive Hooks | The Pre-receive Hooks API allows you to create, list, update and delete pre-receive hooks. |
|
|
3 |
It is only available to authenticated site administrators. Normal users will receive a 404 response if they try to access it.
{% data reusables.user-settings.enterprise-admin-api-classic-pat-only %}
Object attributes
Pre-receive Hook
| Name | Type | Description |
|---|---|---|
name |
string |
The name of the hook. |
script |
string |
The script that the hook runs. |
script_repository |
object |
The GitHub repository where the script is kept. |
environment |
object |
The pre-receive environment where the script is executed. |
enforcement |
string |
The state of enforcement for this hook. |
allow_downstream_configuration |
boolean |
Whether enforcement can be overridden at the org or repo level. |
Possible values for enforcement are enabled, disabled andtesting. disabled indicates the pre-receive hook will not run. enabled indicates it will run and reject
any pushes that result in a non-zero status. testing means the script will run but will not cause any pushes to be rejected.