mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
The Branch protection API has been radically changed by GitHub, add new methods to Branch reflecting it. Branch protection methods are now called on the Branch object itself, rather than awkwardly hanging off the Repository object and requiring branch names to be passed in. This adds an over-arching methods to get, edit and remove protection entirely, as well as fine-grained methods for getting, setting and dropping certain aspects of branch protection, as well as three new objects to encompass querying those aspects. This also destroys Repository.protect_branch(), the endpoint has been removed. The old-style protection attributes on Branch have also been removed to force users onto the new API, since they are still sent, but no longer populated. Fixes #586
33 lines
2.4 KiB
Plaintext
33 lines
2.4 KiB
Plaintext
https
|
|
DELETE
|
|
api.github.com
|
|
None
|
|
/repos/jacquev6/PyGithub/branches/integrations/protection
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
None
|
|
204
|
|
[('status', '204 No Content'), ('x-ratelimit-remaining', '4994'), ('content-length', '330'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2dada6dafd332016bcdf06e42487e520"'), ('date', 'Thu, 10 May 2012 13:56:55 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
|
|
|
|
|
https
|
|
GET
|
|
api.github.com
|
|
None
|
|
/repos/jacquev6/PyGithub/branches/integrations
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
None
|
|
200
|
|
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '395'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"46245273100a0cfb1e8339a2cfb122da"'), ('date', 'Mon, 07 May 2018 12:40:05 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
|
{"name":"integrations","commit":{"sha":"d60943db8c9ae6ca1f9400d378a757e6f281dbde","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/d60943db8c9ae6ca1f9400d378a757e6f281dbde"},"protected":false,"protection_url":"https://api.github.com/repos/jacquev6/PyGithub/branches/integrations/protection"}
|
|
|
|
https
|
|
GET
|
|
api.github.com
|
|
None
|
|
/repos/jacquev6/PyGithub/branches/integrations/protection
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
None
|
|
404
|
|
[('status', '404 Not Found'), ('content-length', '126'), ('x-content-type-options', 'nosniff'), ('content-security-policy', "default-src 'none'"), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'AE1E5031:A39B:2D392574:568E6BC1'), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('x-ratelimit-remaining', '4991'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-xss-protection', '1; mode=block'), ('access-control-allow-credentials', 'true'), ('date', 'Mon, 07 May 2018 12:46:55 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-frame-options', 'deny'), ('x-ratelimit-reset', '1452177625')]
|
|
{"documentation_url":"https://developer.github.com/v3/repos/branches/#get-branch-protection","message":"Branch not protected"}
|