curl --location --request POST 'https://api.github.com/admin/pre-receive-hooks' \
--header 'Content-Type: application/json' \
--data-raw '{
"allow_downstream_configuration": false,
"enforcement": "disabled",
"environment": {
"id": 2
},
"name": "Check Commits",
"script": "scripts/commit_check.sh",
"script_repository": {
"full_name": "DevIT/hooks"
}
}'
{
"allow_downstream_configuration": true,
"enforcement": "string",
"environment": {
"created_at": "string",
"default_environment": true,
"download": {
"downloaded_at": "string",
"message": "string",
"state": "string",
"url": "string"
},
"hooks_count": 0,
"html_url": "string",
"id": 0,
"image_url": "string",
"name": "string",
"url": "string"
},
"id": 0,
"name": "string",
"script": "string",
"script_repository": {
"full_name": "string",
"html_url": "string",
"id": 0,
"url": "string"
}
}
Authorization: Bearer ********************
false
disabled
【GitHub】API开发者 微信交流群
用微信扫右侧二维码,加入【GitHub】API开发者 交流群,互助沟通