-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for configuring protected branches #3
Comments
I'm not crazy about this syntax. This feature basically has an on/off toggle, and then on/off for also requiring admins (see api). Here's an alternate option: required_pull_request_reviews: true # on for everyone
required_pull_request_reviews: false # off for everyone
required_pull_request_reviews:
include_admins: false # on for all non-admins |
The alternative strikes me as a little nicer, fwiw :) |
If we could setup protected branches this way, I think this app would be fantastic. Any idea when this enhancement might occur? Or maybe some guidance as to how someone else might make the change and get an accepted PR? |
@jwsloan you can take a stab at it yourself, and even host your own app for testing. Basically, each top-level key in this plugins config ( I believe that the github apps code just takes values corresponding to api endpoints in a really lightweight way, although you'll have to do your own research there. As I understand, anything in the API is scriptable via github apps framework. So tl;dr, you'll want to create a new key for Good luck! Someone who's written more apps can prob tell you more :) EDIT: keep us posted here if you take a run at it! |
We have a similar thing to protected_branches:
templates:
- pattern: release/*
required_status_checks:
include_admins: true # Enforce required status checks for repository administrators.
strict: true # Require branches to be up to date before merging.
contexts: [continuous-integration/jenkins]
required_pull_request_reviews: true # boolean or 'non-admin'
teams: [team1, team2]
users: [person1, person2] You could then apply it to existing branches, or just respond to |
@nnordrum that looks great, but I feel like I'm missing something. Is that something I can make use of? If so, how? |
Would it be awful to mirror the Update Branch Protection API docs? It seems like I could just write a class with a branches:
master:
protection:
required_status_checks:
strict: true
contexts: []
enforce_admins: true
required_pull_request_reviews:
dismissal_restrictions:
users: []
teams: []
dismiss_stale_reviews: true
require_code_owner_reviews: true
restrictions:
users: []
teams: [] |
@jwsloan that's what I did 👍 #superlazy |
That would be ideal, IMHO. |
Is this still relevant? If so, please comment with any updates or addition details. |
i see a number of the more complex options for protected branches detailed out above, but my most common use case for simple repos is to simply mark it as protected so no one can accidentally force push. what might that simple configuration look like? |
Protected branches have a lot of different toggles:
I think all of these could be configured via something like this:
The text was updated successfully, but these errors were encountered: