| |
---|
| | with WritableUsersAuthenticator => |
---|
| | |
---|
| | /** |
---|
| | * i. List branches |
---|
| | * https://developer.github.com/v3/repos/branches/#list-branches |
---|
| | * https://docs.github.com/en/rest/reference/repos#list-branches |
---|
| | */ |
---|
| | get("/api/v3/repos/:owner/:repository/branches")(referrersOnly { repository => |
---|
| | Using.resource(Git.open(getRepositoryDir(repository.owner, repository.name))) { git => |
---|
| | JsonFormat( |
---|
| |
---|
| | } |
---|
| | }) |
---|
| | |
---|
| | /** |
---|
| | * ii. Get branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-branch |
---|
| | * ii. Get a branch |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-a-branch |
---|
| | */ |
---|
| | get("/api/v3/repos/:owner/:repository/branches/*")(referrersOnly { repository => |
---|
| | Using.resource(Git.open(getRepositoryDir(repository.owner, repository.name))) { |
---|
| | git => |
---|
| |
---|
| | }) |
---|
| | |
---|
| | /* |
---|
| | * iii. Get branch protection |
---|
| | * https://developer.github.com/v3/repos/branches/#get-branch-protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * iv. Update branch protection |
---|
| | * https://developer.github.com/v3/repos/branches/#update-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * v. Remove branch protection |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * vi. Get required status checks of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * vii. Update required status checks of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#update-required-status-checks-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * viii. Remove required status checks of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-required-status-checks-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * ix. List required status checks contexts of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * x. Replace required status checks contexts of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#replace-required-status-checks-contexts-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xi. Add required status checks contexts of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xii. Remove required status checks contexts of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xiii. Get pull request review enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-pull-request-review-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xiv. Update pull request review enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xv. Remove pull request review enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-pull-request-review-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xvi. Get required signatures of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-required-signatures-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xvii. Add required signatures of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#add-required-signatures-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xviii. Remove required signatures of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-required-signatures-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xix. Get admin enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-admin-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xx. Add admin enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#add-admin-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxi. Remove admin enforcement of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-admin-enforcement-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxii. Get restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#get-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxiii. Remove restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxiv. List team restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxv. Replace team restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxvi. Add team restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxvii. Remove team restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxviii. List user restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxix. Replace user restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#replace-user-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxx. Add user restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#add-user-restrictions-of-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxi. Remove user restrictions of protected branch |
---|
| | * https://developer.github.com/v3/repos/branches/#remove-user-restrictions-of-protected-branch |
---|
| | * https://docs.github.com/en/rest/reference/repos#update-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * v. Delete branch protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#delete-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * vi. Get admin branch protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-admin-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * vii. Set admin branch protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#set-admin-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * viii. Delete admin branch protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#delete-admin-branch-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * ix. Get pull request review protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-pull-request-review-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * x. Update pull request review protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#update-pull-request-review-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xi. Delete pull request review protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#delete-pull-request-review-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xii. Get commit signature protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-commit-signature-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xiii. Create commit signature protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#create-commit-signature-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xiv. Delete commit signature protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#delete-commit-signature-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xv. Get status checks protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-status-checks-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xvi. Update status check protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#update-status-check-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xvii. Remove status check protection |
---|
| | * https://docs.github.com/en/rest/reference/repos#remove-status-check-protection |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xviii. Get all status check contexts |
---|
| | * https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-all-status-check-contexts |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xix. Add status check contexts |
---|
| | * https://docs.github.com/en/rest/reference/repos#add-status-check-contexts |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xx. Set status check contexts |
---|
| | * https://docs.github.com/en/rest/reference/repos#set-status-check-contexts |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxi. Remove status check contexts |
---|
| | * https://docs.github.com/en/rest/reference/repos#remove-status-check-contexts |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxii. Get access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxiii. Delete access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#delete-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxiv. Get apps with access to the protected branch |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-apps-with-access-to-the-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxv. Add app access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#add-app-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxvi. Set app access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#set-app-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxvii. Remove app access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#remove-app-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxviii. Get teams with access to the protected branch |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-teams-with-access-to-the-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxix. Add team access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#add-team-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxx. Set team access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#set-team-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxi. Remove team access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#remove-team-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxii. Get users with access to the protected branch |
---|
| | * https://docs.github.com/en/rest/reference/repos#get-users-with-access-to-the-protected-branch |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxiii. Add user access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#add-user-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxiv. Set user access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#set-user-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /* |
---|
| | * xxxv. Remove user access restrictions |
---|
| | * https://docs.github.com/en/rest/reference/repos#remove-user-access-restrictions |
---|
| | */ |
---|
| | |
---|
| | /** |
---|
| | * Enabling and disabling branch protection: deprecated? |
---|
| |
---|
| | |